Merge pull request #549 from isocolsky/ref/logs

Skip logging of notification requests
This commit is contained in:
Matias Alejo Garcia 2016-08-02 11:54:34 -03:00 committed by GitHub
commit 61ffe309f8
1 changed files with 8 additions and 3 deletions

View File

@ -65,9 +65,14 @@ ExpressApp.prototype.start = function(opts, cb) {
return req.copayerId
});
this.app.use(morgan(' :remote-addr :date[iso] ":method :url" :status :res[content-length] :response-time ":user-agent" :walletId :copayerId'));
var logFormat = ':remote-addr :date[iso] ":method :url" :status :res[content-length] :response-time ":user-agent" :walletId :copayerId';
var logOpts = {
skip: function(req, res) {
if (res.statusCode != 200) return false;
return req.path.indexOf('/notifications/') >= 0;
}
};
this.app.use(morgan(logFormat, logOpts));
}