Created
January 19, 2015 10:31
-
-
Save meredian/d0376dd410a04b0bafa3 to your computer and use it in GitHub Desktop.
Short test for bunyan-syslog module
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 bunyan = require('bunyan'); | |
var syslog = require('bunyan-syslog'); | |
var bunyanInstance = bunyan.createLogger({ | |
name: 'bunyan-syslog-test', | |
streams: [{ | |
level: 'trace', | |
type: 'raw', | |
stream: syslog.createBunyanStream({ | |
type: 'sys', | |
facility: 16, | |
host: "127.0.0.1", | |
port: 514 | |
}) | |
}, { | |
level: 'trace', | |
stream: process.stdout | |
}] | |
}); | |
bunyanInstance.warn("This is short output"); | |
bunyanInstance.warn(process.env, "This is log output with stacktrace and a log of metadata: " + new Error().stack); |
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
curl https://raw.githubusercontent.com/creationix/nvm/v0.18.0/install.sh | bash | |
source ~/.bash_profile | |
nvm install 0.10 | |
nvm alias default 0.10 | |
cd ~/path/to/file | |
npm install bunyan bunyan-syslog | |
node index.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment