feat(loggly): change tag based on base_url, logs internal server errors

This commit is contained in:
Matteo Pagliazzi
2014-12-13 14:48:14 +01:00
parent 9d6caaa138
commit dac2fc682d
3 changed files with 13 additions and 5 deletions
+3 -2
View File
@@ -284,14 +284,15 @@ api.cron = function(req, res, next) {
User.findById(user._id, cb);
}
], function(err, saved) {
if(err) logging.loggly({error: e, stack: e.stack})
if(err) logging.loggly({error: "Cron caught", stack: e.stack || e})
res.locals.user = saved;
next(err,saved);
user = progress = quest = null;
});
}catch(e){
logging.loggly({
error: e.stack || e
error: "Cron uncaught",
stack: e.stack || e
});
throw e;
}