Skip to content

Instantly share code, notes, and snippets.

@meredian
Created January 19, 2015 10:31
Show Gist options
  • Save meredian/d0376dd410a04b0bafa3 to your computer and use it in GitHub Desktop.
Save meredian/d0376dd410a04b0bafa3 to your computer and use it in GitHub Desktop.
Short test for bunyan-syslog module
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);
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