feat(loggly): add test log, use only in production and add sample config

This commit is contained in:
Matteo Pagliazzi
2014-12-12 12:17:48 +01:00
parent 7356e0bafe
commit af1ff6d740
3 changed files with 23 additions and 13 deletions
+14 -12
View File
@@ -3,18 +3,20 @@ 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']
});
if (nconf.get('NODE_ENV') == 'production'){
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;