Created
January 7, 2016 18:51
-
-
Save gcoonrod/c49fce9d68b382cb76f4 to your computer and use it in GitHub Desktop.
Custom Logging Levels in AH 12.4
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
exports.default = { | |
logger: function(api) { | |
var logger = { | |
transports: [] | |
}; | |
logger.transports.push(function(api, winston) { | |
return new(winston.transports.Console)({ | |
colorize: true, | |
level: 'info', | |
timestamp: true, | |
handleExceptions: true, | |
humanReadableUnhandledException: true, | |
exitOnError: false | |
}); | |
}); | |
var levels = { | |
"trace": 0, | |
"debug": 1, | |
"info": 2, | |
"notice": 3, | |
"warning": 4, | |
"error": 5, | |
"crit": 6, | |
"alert": 7, | |
"emerg": 8 | |
}; | |
var colors = { | |
"trace": "magenta", | |
"debug": "blue", | |
"info": "green", | |
"notice": "yellow", | |
"warning": "red", | |
"error": "red", | |
"crit": "red", | |
"alert": "yellow", | |
"emerg": "red" | |
}; | |
logger.levels = levels; | |
logger.colors = colors; | |
return logger; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using this configuration for the AH logger I see log entries at all logging levels instead of just at info and above.