feat(loggly): add loggly

This commit is contained in:
Matteo Pagliazzi 2014-12-12 12:11:26 +01:00
parent ae762837e2
commit 7356e0bafe
2 changed files with 19 additions and 0 deletions

View file

@ -30,6 +30,7 @@
"jade": "~1.7.0",
"js2xmlparser": "~0.1.2",
"lodash": "~2.4.1",
"loggly": "~1.0.8",
"method-override": "~2.2.0",
"moment": "~2.8.3",
"mongoose": "~3.8.17",

View file

@ -3,6 +3,19 @@ var winston = require('winston');
require('winston-mail').Mail;
require('winston-newrelic');
var loggly = require('loggly').createClient({
token: nconf.get('LOGGLY:token'),
subdomain: nconf.get('LOGGLY:subdomain'),
auth: {
username: nconf.get('LOGGLY:username'),
password: nconf.get('LOGGLY:password')
},
//
// Optional: Tag to send with EVERY log message
//
tags: ['heroku']
});
var logger;
if (logger == null) {
@ -49,3 +62,8 @@ module.exports.error = function(/* variable args */) {
if (logger)
logger.error.apply(logger, arguments);
};
module.exports.loggly = function(/* variable args */){
if(loggly)
loggly.log(loggly, arguments);
};