-
Notifications
You must be signed in to change notification settings - Fork 31
[bug] Unable to use evlog in nuxt server middleware #210
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Hey, I’m running into an issue where I can't seem to use evlog inside a server middleware. It throws the following error:
[evlog] Logger not initialized. Make sure the evlog Nitro plugin is registered. If using Nuxt, add "evlog" to your modules.
It works fine on api routes but fails in middleware
This is what the evlog AI said:
Thank you! :)
Reproduction
To reproduce this just create a Nuxt server middleware and try to log with evlog
example snippet:
export default defineEventHandler(async (event) => {
const logger = useLogger(event, "test");
logger.set({ user: { id: "test", plan: "enterprise" } }) ;
});
Logs

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working