Skip to content

Instantly share code, notes, and snippets.

@mchelen
Last active November 7, 2017 02:14
Show Gist options
  • Save mchelen/0609eca284d69164e683454d454f63c3 to your computer and use it in GitHub Desktop.
Save mchelen/0609eca284d69164e683454d454f63c3 to your computer and use it in GitHub Desktop.
bunyan file log test
*.log
node_modules
var bunyan = require('bunyan');
var log = bunyan.createLogger({
name: 'myapp',
streams: [
{
level: 'info',
stream: process.stdout // log INFO and above to stdout
},
{
level: 'debug',
path: 'debug.log'
}
]
});
log.info('hello');
log.debug('world');
//prevents debug.log from being written:
//process.exit();
{
"name": "0609eca284d69164e683454d454f63c3",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/0609eca284d69164e683454d454f63c3.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://gist.github.com/0609eca284d69164e683454d454f63c3"
},
"homepage": "https://gist.github.com/0609eca284d69164e683454d454f63c3",
"dependencies": {
"bunyan": "^1.8.12"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment