Skip to content

Instantly share code, notes, and snippets.

@indexzero
Created May 16, 2011 03:51
Show Gist options
  • Save indexzero/973904 to your computer and use it in GitHub Desktop.
Save indexzero/973904 to your computer and use it in GitHub Desktop.
Using node-loggly and winston together
var winston = require('winston'),
loggly = require('loggly');
var client = loggly.createClient({
subdomain: "your-subdomain",
auth: {
username: "your-username",
password: "your-password"
}
});
client.getInputs(function (err, inputs) {
if (err) throw err;
var input = inputs.filter(function (i) { return i.name === 'your-input-name' })[0];
winston.add(winston.transports.Loggly, {
subdomain: 'your-subdomain',
inputToken: input.input_token
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment