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. Add 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.
...
Sunbird desktop app code can be categorized into different sections based on the task that it dose. Grouping logs based on categorizes help debug, sync and analyze the different aspects of the Desktop app. This task can have a different log folder and each file inside this can be stored based on the date they are created. This files can be in yyyy-MM-dd<logType>.log pattern.
- App Install: These logs will be generated when the app is being installed on the system(Window, Ubuntu or Mac). Here we need to hook on into Elector to Elector get these logs.
- StartUp / App launch: These logs will be generated when the app is being launched. All the logs generated after user clicks on the app link and app is ready to use will be logged here.
- Runtime: These logs will get generated for all user-initiated tasks. Like API call, import/export/download request, content read, filter applied, etc. All logs from UI will also be collected here.
- Process: These logs are for all the asynchronous functions/tasks that get executed in the background. Like import/export/download jobs, telemetry sync, device registry, etc.
- Default/Common: Logs generated from code that is common which cant be grouped are collected here.
...