Nuxt3 Logging with request id #27253
Unanswered
marc-arnoult
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
In my current Nuxt 2 project, I use AsyncLocalStorage to set the request ID in the logger within the request context. This approach eliminates the need to pass the request ID throughout the application manually.
For this feature, I employ Express with a middleware to enable it. This middleware is the first server middleware in the stack.
Here is an example:
With Nuxt 3, I no longer have this feature with serverMiddleware and the next() behavior.
Is it possible to achieve something similar in Nuxt 3? I've explored the asyncContext feature without success.
Regards,
Marc
Beta Was this translation helpful? Give feedback.
All reactions