express-winston icon indicating copy to clipboard operation
express-winston copied to clipboard

log response body based on status code.

Open shashanksapre opened this issue 4 years ago • 0 comments

In the readme like it's given an example of how to change the log level based on the response status code. Is it possible to push response body parts to responseWhitelist array based on response status code?

For example, when the response status code is 400, my express server responds with error code, error message, and error description. If the response status is 404, there's no body. So I want to log code, message, and description when the status code is 400.

shashanksapre avatar Jan 22 '21 13:01 shashanksapre