mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
remove legacy loggly code
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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)({});
|
||||
@@ -49,9 +32,4 @@ module.exports.warn = function(/* variable args */) {
|
||||
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);
|
||||
};
|
||||
};
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user