-
hi, i was wondering if it was possible to replace the logger for downstream handlers with a child logger in the middleware. i'm trying to do this because i'm trying to create a child logger based off request headers and have the downstream endpoints use it. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
Sure, @elee1766 If you're using There are similar methods in Here is what you should do:
There was also a dedicated discussion on custom loggers and child loggers too: #1311 I hope it helps. |
Beta Was this translation helpful? Give feedback.
-
perhaps i need to read the code some more - does the middleware abstraction for express-zod-api not include a parallel to "next"-style middleware? to me it would make a lot of sense if upstream middleware could call the downstream handler and therefore provide a child logger, (and any other child things, like modifying the http request itself for instance) |
Beta Was this translation helpful? Give feedback.
-
The feature of |
Beta Was this translation helpful? Give feedback.
The feature of
childLoggerProvider
is now available in recently released version 16.4.0 🚀, @elee1766