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

...

Logs Categorize:

Sunbird desktop app code log can be categorized into different sections based on the task that it dosedoes. 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.



Log CategoryEnabledSyncs to platformLog storageLog format
1

App Install / Update

Enabled by default.NoLast 3 Logs will be storedString
2

Application

Disabled, can be enabled when needed for a short amount of time.NoLast 3 Logs will be storedString
3

Crash

Enabled by default.YesLast 10 Logs will be storedString
4

Error

Enabled by default.YesLast 500 Logs will be storedString
5

Performance

Enabled by default.YesLast 100 Logs will be storedJSON

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.

...

Code Block
languagejs
titlePerf Log format
collapsetrue
{
    id: '<uuid>',
    timeTaken: '<time taken to complete the task>',
    createdOn: '<created date>',
    type: '<network|system>',
    subType: '<import,download,export etc>',
    did:'<system device id>',
    size: '<size of the object>',
    extras: {<'task specific data'>}
  }

...

Syncing Perf log to the platform:

...

We can convert perf log to telemetry metrics event. This will be synced along with all the telemetry events to the platform. 

Logs levels

The desktop app will have all traditional log levels and some custom levels.

...