From 61ae5c74209e7399a817b48d7f6d4afc4cbed4fc Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Sat, 13 Dec 2014 15:01:38 +0100 Subject: [PATCH] fix(loggly): enable only manually --- config.json.example | 1 + src/logging.js | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) 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); };