Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

  1. App Install: These logs will be generated when the app is being installed on the system(Window , or Ubuntu or Mac). Here we need to hook into Elector the Electron installation process to get these logs. 

  2. 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.

  3. 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.

  4. 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.

  5. Default/Common: Logs generated from code that is common which cant be grouped are collected here. 

...