Skip to content

Commit

Permalink
#37 add oneapm for monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
hailiang-wang committed Apr 22, 2016
1 parent c3a4d0f commit dc553af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ tx.exe

# docker build
dockerlize/build

# OneAPM
oneapm.js
6 changes: 5 additions & 1 deletion loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ var nconf = require('nconf'),
url = require('url'),
path = require('path'),
fork = require('child_process').fork,

async = require('async'),
logrotate = require('logrotate-stream'),
file = require('./src/file'),
Expand All @@ -15,6 +14,11 @@ nconf.argv().env('__').file({
file: path.join(__dirname, '/config.json')
});

// https://github.com/rockq-org/cnodebb/issues/37
if(nconf.get('is_oneapm') == 'true'){
require('oneapm');
}

var pidFilePath = __dirname + '/pidfile',
output = logrotate({ file: __dirname + '/logs/output.log', size: '1m', keep: 3, compress: true }),
silent = nconf.get('silent') === 'false' ? false : nconf.get('silent') !== false,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"nodemailer": "2.0.0",
"nodemailer-sendmail-transport": "1.0.0",
"nodemailer-smtp-transport": "^2.4.1",
"oneapm": "^1.2.20",
"passport": "^0.3.0",
"passport-local": "1.0.0",
"postcss": "^5.0.13",
Expand Down

0 comments on commit dc553af

Please sign in to comment.