Table of Contents
Background:
Currently, Deskstop App has a logging system in place. That is configurable and allows storing of backups on log rotation. Desktop App stores all type('all'|'trace'|'fatal'|'error'|'off'|'info'|'warn'|'debug') of logs in app.log file that has a rotation policy of 10 MB and stores compressed backup up to 3 files. And also has a dedicated error.log file that stores only error logs(10 MB | 3 backups). This is built on top of log4js. It is difficult to query based on date and there is no distinction between logs.
...
Log Category | Enabled | Syncs to platform | Log storage | Log format | |
---|---|---|---|---|---|
1 | App Install / Update | Enabled by default. | No | Last 3 Logs will be stored | String |
2 | Application | Enabled by default with App log level set to 'INFO'. | No | Last 7 days logs. | String |
3 | Debug | Disabled, can can be enabled when needed for a short amount of time. | No | Last 3 Logs will be stored | String |
34 | Crash | Enabled by default. | Yes | Last 10 Logs will be stored | String |
45 | Error | Enabled by default. | Yes | Last 500 Logs will be stored | String |
56 | Performance | Enabled by default. | Yes | Last 100 Logs will be stored | JSON |
...
All logs generated by the app while its running can be collected into one filewhich has a higher log level than the app log level will be collected here. By default , this log will be disabled. It can be enabled when it needs for a specified time then it can be disabled. app, log level will be set to 'INFO'.
Debug:
All logs generated by the app irrespective of the app log level will be collected here. This will be enabled based on the user request for a short amount of time. When enable App log level will be set to 'ALL'. This is used when we cant debug from telemetry or from application logs. These logs can be sent when Rasing support tickets in the future.
Crash:
These logs get generated when the app(Electron) crashes. Logs generated will be in minidump format and these logs need to be further processed to do any analysis.
...
Note: This requires an implementation design review.
Solution 2: Processing minidump in the desktop app
...
Syncing Perf log to the platform:
Note: This requires an implementation design review.
Solution 1: Sync to new API.
We require new API sync this logs to the platform and to analyze/visualize.
Solution 2: Log Telemetry metrics event.
We can convert perf log to telemetry metrics event. This will be synced along with all the telemetry events to the platform.
Solution 3: Local analytics.
We can create local analytic with all the perf logs and refer to this when needed.
Logs levels
The desktop app will have all traditional log levels and some custom levels.
...