fix(loggly): enable only manually

This commit is contained in:
Matteo Pagliazzi 2014-12-13 15:01:38 +01:00
parent 012e579cfe
commit 61ae5c7420
2 changed files with 5 additions and 4 deletions

View file

@ -44,6 +44,7 @@
}, },
"IAP_GOOGLE_KEYDIR": "/path/to/google/public/key/dir/", "IAP_GOOGLE_KEYDIR": "/path/to/google/public/key/dir/",
"LOGGLY": { "LOGGLY": {
"enabled": false,
"subdomain": "subdomain", "subdomain": "subdomain",
"token": "token", "token": "token",
"username": "username", "username": "username",

View file

@ -5,8 +5,8 @@ require('winston-newrelic');
var logger, loggly; var logger, loggly;
if (nconf.get('NODE_ENV') == 'production'){ if (nconf.get('LOGGLY:enabled')){
var loggly = require('loggly').createClient({ loggly = require('loggly').createClient({
token: nconf.get('LOGGLY:token'), token: nconf.get('LOGGLY:token'),
subdomain: nconf.get('LOGGLY:subdomain'), subdomain: nconf.get('LOGGLY:subdomain'),
auth: { auth: {
@ -67,6 +67,6 @@ module.exports.error = function(/* variable args */) {
}; };
module.exports.loggly = function(/* variable args */){ module.exports.loggly = function(/* variable args */){
if(loggly) if (loggly)
loggly.log.apply(loggly, arguments); loggly.log.apply(loggly, arguments);
}; };