Logger

TIP

GROWI uses Bunyan and browser-bunyan. Older code uses debug for logging, but debug() can be replaced with Bunyan's logger.debug().

Log Levels

See Bunyan#Levels for more about log levels.

By default, log levels are set as below.

  • Development
    • info
  • Production
    • info

Log Method

See Bunyan#Log Method API.

Edit Log Setting

There are 2 ways to edit the log setting.

Edit Log Setting for Indivisual Environments

  • Development
    • config/logger/config.dev.js
  • Production
    • config/logger/config.prod.js

Format

  • Format as ${namespace}: '${level}',.
    e.g.



     
     


    module.exports = {
      default: 'info',
    
      'growi:crowi': 'debug',
      'growi:routes:login-passport': 'debug',
    }
    
  • The default log level can be set with default key.

Edit Log Setting with Environmental Variables

WARNING

Enviroment variables override the setting files.

Format

  • ${LEVEL}=${namespace1},${namespace2}, ...

e.g.

DEBUG=growi:crowi,growi:routes:login-passport
WARN=growi:crowi:express-init
Last Updated: 6/10/2019, 7:20:34 AM