morgan-body
morgan-body copied to clipboard
Does not log Request if skip option is used
Hi there
When I configure like so:
morganBody(app, {
skip: function(req, res) { return res.statusCode < 400 },
}
Then the output looks like
Request Body:
{ ... }
Response Body:
{ ... }
Response: 500 10.371 ms
When I configure without skip: morganBody(app)
Then the output looks like
Request: POST /api/v1/auth/signup at Sat Jan 16 2021 22:58:37 GMT+0100...
Request Body:
{...}
Response Body:
{...}
Response: 500 10.412 ms
For some reason Request: POST /api/v1/auth/signup at Sat Jan 16 2021 22:58:37 GMT+0100...
does not get logged. Maybe I'm doing something wrong, have you seen this issue before?
Best regards, Felix
hmmm I have not, I believe someone else PR'd the skip
function, I would need to dig, don't have time right now, there are pretty thorough unit tests you can leverage if you'd like to give it a run @w6e