remove legacy loggly code

This commit is contained in:
Matteo Pagliazzi
2016-05-27 16:38:55 +02:00
parent 01a7880bc9
commit 2d81b31c3a
3 changed files with 2 additions and 32 deletions

View File

@@ -59,7 +59,6 @@
"js2xmlparser": "~1.0.0",
"lodash": "^3.10.1",
"lodash.setwith": "^4.2.0",
"loggly": "~1.0.8",
"markdown-it": "^6.0.1",
"merge-stream": "^1.0.0",
"method-override": "^2.3.5",

View File

@@ -1,24 +1,7 @@
var nconf = require('nconf');
var winston = require('winston');
var logger, loggly;
// Currently disabled
if (nconf.get('LOGGLY:enabled')){
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-'+nconf.get('BASE_URL'))],
json: true
});
}
var logger;
if (!logger) {
logger = new (winston.Logger)({});
@@ -50,8 +33,3 @@ module.exports.error = function(/* variable args */) {
if (logger)
logger.error.apply(logger, arguments);
};
module.exports.loggly = function(/* variable args */){
if (loggly)
loggly.log.apply(loggly, arguments);
};

View File

@@ -11,13 +11,6 @@ module.exports = function(err, req, res, next) {
"\n\nbody: " + JSON.stringify(req.body) +
(res.locals.ops ? "\n\ncompleted ops: " + JSON.stringify(res.locals.ops) : "");
logging.error(stack);
/*logging.loggly({
error: "Uncaught error",
stack: (err.stack || err.message || err),
body: req.body, headers: req.header,
auth: req.headers['x-api-user'],
originalUrl: req.originalUrl
});*/
var message = err.message ? err.message : err;
message = (message.length < 200) ? message : message.substring(0,100) + message.substring(message.length-100,message.length);
res.status(500).json({err:message}); //res.end(err.message);