feat(loggly): add test log, use only in production and add sample config

This commit is contained in:
Matteo Pagliazzi 2014-12-12 12:17:48 +01:00
parent 7356e0bafe
commit af1ff6d740
3 changed files with 23 additions and 13 deletions

View file

@ -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"
}
}

View file

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

View file

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