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.
...
Solution:
Logs Categorize:
Sunbird desktop app log can be categorized into different sections based on the task or meaning that it doesprovides. Grouping logs based on categorizes help debug, sync and analyze the different aspects of the Desktop app.
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 | Disabled, can be enabled when needed for a short amount of time. | No | Last 3 Logs will be stored | String |
3 | Crash | Enabled by default. | Yes | Last 10 Logs will be stored | String |
4 | Error | Enabled by default. | Yes | Last 500 Logs will be stored | String |
5 | Performance | Enabled by default. | Yes | Last 100 Logs will be stored | JSON |
App Install / Update:
These logs will be generated when the app is being installed on the system(Window or Ubuntu). These logs will be generated by hooking into Electron-builder installation hooks. We can keep 2-3 installation logs.
...
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. The app keeps the last 10 crash logs and sync to the platform for further processing using the network queue.
Syncing Crash logs to the platform:
...
- API to store minidumps: This API will accept minidumps from all apps and stores this the same in the blob.
- Batch job: This job will retrieve minidumps from the blob and using electron symbols and minidump library will create meaning full data. This data can be stored in Druid or Elastic search for analysis.
...
All unhandled exceptions and unhandled rejections will be collected in these logs. The app keeps the last 500 crash logs and sync to the platform for further processing using the network queue.
...