mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-14 02:02:19 +00:00
feat(loggly): add test log, use only in production and add sample config
This commit is contained in:
parent
7356e0bafe
commit
af1ff6d740
3 changed files with 23 additions and 13 deletions
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue