Skip to content

Instantly share code, notes, and snippets.

@vogdb
Created August 14, 2014 08:39
Show Gist options
  • Save vogdb/54b3baeed607f75e57a8 to your computer and use it in GitHub Desktop.
Save vogdb/54b3baeed607f75e57a8 to your computer and use it in GitHub Desktop.
log4js set level test
{
"appenders": [
{
"type": "file",
"filename": "info.log",
"maxLogSize": 20480,
"backups": 10,
"level": "INFO"
},
{
"type": "file",
"filename": "error.log",
"maxLogSize": 20480,
"backups": 10,
"level": "ERROR"
}
]
}
var log4js = require('log4js');
log4js.configure('./log4js.json', {reloadSecs: 300});
var logger = log4js.getLogger();
logger.warn('warn');
logger.error('error');
logger.info('info');
logger.debug('debug');
@vogdb
Copy link
Author

vogdb commented Aug 14, 2014

Conf.json doesn't configure log level properly and the error.log contains messages of all levels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment