diff --git a/config.json.example b/config.json.example index caedcf3ae9..f50242f74c 100644 --- a/config.json.example +++ b/config.json.example @@ -42,5 +42,11 @@ "client_id":"client_id", "client_secret":"client_secret" }, - "IAP_GOOGLE_KEYDIR": "/path/to/google/public/key/dir/" + "IAP_GOOGLE_KEYDIR": "/path/to/google/public/key/dir/", + "LOGGLY": { + "subdomain": "subdomain", + "token": "token", + "username": "username", + "password": "password" + } } diff --git a/src/logging.js b/src/logging.js index 07e795e137..9cfe8cfbd8 100644 --- a/src/logging.js +++ b/src/logging.js @@ -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; diff --git a/src/server.js b/src/server.js index 8e551f7891..bd0e1310b0 100644 --- a/src/server.js +++ b/src/server.js @@ -49,6 +49,8 @@ if (cluster.isMaster && (isDev || isProd)) { }); autoinc.init(db); + logging.loggly('test from beta'); + // load schemas & models require('./models/challenge'); require('./models/group');