dspace-angular
dspace-angular copied to clipboard
More and more-configurable logging
Currently dspace-angular gives very little insight into its operation. There is very little logging in place and no control over it.
The UI runs in two environments: the browser and Nodejs. They have somewhat different requirements.
In both environments:
- The UI should log significant progress in its operations, as well as errors and diagnostic information. Log records should be classified by "level" (debug, info, warning, error etc.) and possibly by subsystem.
- We should be able to adjust the level of detail that is logged.
- If reasonably possible, we should be able to adjust the level of detail for specific classes or modules.
- Each environment should have its own logging configuration.
- Selection of log records should be readily configurable at startup time, possibly even during runtime.
- All log records should be timestamped.
In the browser:
- Log records should go to the console, because there is no other good place for them and a console is always available.
In Nodejs (the server environment):
- Log records should not be just spewed on the console. In production there won't be a console. It should be easy to direct records to specific files.
- If reasonably possible, we should be able to direct logging for different levels or different subsystems independently.
- Direction of log records should be readily configurable at startup time, possibly even during runtime.
There are logging frameworks for Node, such as Winston, which can handle direction, selection and formatting for us. They seem a bit less developed than what we're used to in the Java ecosystem. We will probably have to roll our own configuration support, but it might be a useful contribution back to whatever framework we choose.
Configuration is really a larger issue, and I will make a separate proposal for that which can be used by the logging code.
Flagging as "needs discussion" and moving to the 7.1 board for that discussion. At that point we can reprioritize as needed.