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/",
"LOGGLY": {
"enabled": false,
"subdomain": "subdomain",
"token": "token",
"username": "username",

View file

@ -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);
};