You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For human readable logs I think it makes sense to have a log at the beginning of the request and at the end so it's easy to see in the logs what happens between the start and end of the request. Right now I'm accomplishing it by doing this:
server.use((req, res, next) => {
// log the start of the request
logger.info({msg: "Handling request", "url": req.url})
return expressLogger(req, res, next);
});
However, this method doesn't exclude routes from my ignorePaths, so it seems like this would be pretty nice to just have a function or something in the configuration that gets run before the rest of the request code gets executed that can print out something before the request runs. This took me a lot of trial and error to find the right placement here. I'm curious if other people have this need, and if this is the best practice for accomplishing this today.
The text was updated successfully, but these errors were encountered:
For human readable logs I think it makes sense to have a log at the beginning of the request and at the end so it's easy to see in the logs what happens between the start and end of the request. Right now I'm accomplishing it by doing this:
However, this method doesn't exclude routes from my
ignorePaths
, so it seems like this would be pretty nice to just have a function or something in the configuration that gets run before the rest of the request code gets executed that can print out something before the request runs. This took me a lot of trial and error to find the right placement here. I'm curious if other people have this need, and if this is the best practice for accomplishing this today.The text was updated successfully, but these errors were encountered: