mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
remove legacy loggly code
This commit is contained in:
@@ -59,7 +59,6 @@
|
|||||||
"js2xmlparser": "~1.0.0",
|
"js2xmlparser": "~1.0.0",
|
||||||
"lodash": "^3.10.1",
|
"lodash": "^3.10.1",
|
||||||
"lodash.setwith": "^4.2.0",
|
"lodash.setwith": "^4.2.0",
|
||||||
"loggly": "~1.0.8",
|
|
||||||
"markdown-it": "^6.0.1",
|
"markdown-it": "^6.0.1",
|
||||||
"merge-stream": "^1.0.0",
|
"merge-stream": "^1.0.0",
|
||||||
"method-override": "^2.3.5",
|
"method-override": "^2.3.5",
|
||||||
|
|||||||
@@ -1,24 +1,7 @@
|
|||||||
var nconf = require('nconf');
|
var nconf = require('nconf');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
|
||||||
var logger, loggly;
|
var logger;
|
||||||
|
|
||||||
// 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
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!logger) {
|
if (!logger) {
|
||||||
logger = new (winston.Logger)({});
|
logger = new (winston.Logger)({});
|
||||||
@@ -50,8 +33,3 @@ module.exports.error = function(/* variable args */) {
|
|||||||
if (logger)
|
if (logger)
|
||||||
logger.error.apply(logger, arguments);
|
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) +
|
"\n\nbody: " + JSON.stringify(req.body) +
|
||||||
(res.locals.ops ? "\n\ncompleted ops: " + JSON.stringify(res.locals.ops) : "");
|
(res.locals.ops ? "\n\ncompleted ops: " + JSON.stringify(res.locals.ops) : "");
|
||||||
logging.error(stack);
|
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;
|
var message = err.message ? err.message : err;
|
||||||
message = (message.length < 200) ? message : message.substring(0,100) + message.substring(message.length-100,message.length);
|
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);
|
res.status(500).json({err:message}); //res.end(err.message);
|
||||||
|
|||||||
Reference in New Issue
Block a user