Created
August 14, 2014 08:39
-
-
Save vogdb/54b3baeed607f75e57a8 to your computer and use it in GitHub Desktop.
log4js set level test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"appenders": [ | |
{ | |
"type": "file", | |
"filename": "info.log", | |
"maxLogSize": 20480, | |
"backups": 10, | |
"level": "INFO" | |
}, | |
{ | |
"type": "file", | |
"filename": "error.log", | |
"maxLogSize": 20480, | |
"backups": 10, | |
"level": "ERROR" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Conf.json doesn't configure log level properly and the error.log contains messages of all levels.