write logs

  1. # Use the logger of the global app object
  2. this.app.logger.info()
  3. this.app.logger.error()
  4. this.app.logger.debug()
  5. this.app.logger.warn()
  6. this.app.logger.write()

log location

before packaging: the root directory of the project

  1. electron-egg/logs

packaged: software cache Directory

  1. # windows (example)
  2. C:\Users\Administrator\AppData\Roaming\ee\logs
  3. # macOS (example)
  4. Users/apple/Library/Application Support/ee/logs
  5. # Linux (example)
  6. $XDG_CONFIG_HOME or ~/.config/ee/logs

custom log location

  1. # Edit the config.default.js file
  2. config.logger = {
  3. dir: path.join(appInfo.execDir, 'logs'), // Log directory
  4. }

Log files in json format

  1. # Edit the config.default.js file
  2. config.logger = {
  3. outputJSON: true,
  4. }