skip log for notification requests

This commit is contained in:
Ivan Socolsky 2016-08-02 11:37:43 -03:00
parent 7e3660adf5
commit 0403b5ab94
No known key found for this signature in database
GPG Key ID: FAECE6A05FAA4F56
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));
}