Last active
July 9, 2016 22:13
-
-
Save elhoyos/4ff213e1469f8ca38c5f to your computer and use it in GitHub Desktop.
Bunyan logging
This file contains hidden or 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 bunyan = require('bunyan'); | |
var logger = bunyan.createLogger({ | |
name: 'myapp', | |
serializers: bunyan.stdSerializers | |
}); | |
// When using standard serializers, an Error object can be passed in "err" | |
logger.fatal({err: new Error('Something wrong'), payload: payload}, 'Ooops'); | |
// The simplest | |
logger.fatal(new Error('Something wrong'), 'Ooops'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More info here: https://github.com/trentm/node-bunyan#log-method-api