diff --git a/config.json.example b/config.json.example index f50242f74c..74e2f0822c 100644 --- a/config.json.example +++ b/config.json.example @@ -44,6 +44,7 @@ }, "IAP_GOOGLE_KEYDIR": "/path/to/google/public/key/dir/", "LOGGLY": { + "enabled": false, "subdomain": "subdomain", "token": "token", "username": "username", diff --git a/src/logging.js b/src/logging.js index 441af207ee..5c0d973812 100644 --- a/src/logging.js +++ b/src/logging.js @@ -5,8 +5,8 @@ require('winston-newrelic'); var logger, loggly; -if (nconf.get('NODE_ENV') == 'production'){ - var loggly = require('loggly').createClient({ +if (nconf.get('LOGGLY:enabled')){ + loggly = require('loggly').createClient({ token: nconf.get('LOGGLY:token'), subdomain: nconf.get('LOGGLY:subdomain'), auth: { @@ -67,6 +67,6 @@ module.exports.error = function(/* variable args */) { }; module.exports.loggly = function(/* variable args */){ - if(loggly) - loggly.log.apply(loggly, arguments); + if (loggly) + loggly.log.apply(loggly, arguments); };