How to log middleware?
Unanswered
Barbary Lion posted this in #help-forum
Barbary LionOP
I'm trying to create logging in middleware.ts at the root of the repo, but console.log/warn/errors don't seem to work in middleware.
I've even tried Pino logger but to no avail. Terminal shows no logs, browser shows no logs.
I understand that it's edge but there has to be a way to debug middleware stuff locally.
Any help is super appreciated!
I've even tried Pino logger but to no avail. Terminal shows no logs, browser shows no logs.
I understand that it's edge but there has to be a way to debug middleware stuff locally.
Any help is super appreciated!
4 Replies
@B33fb0n3 can you share your file structure?
Barbary LionOP
Standard nextjs app router with middleware.ts at the root.
@Barbary Lion Standard nextjs app router with middleware.ts at the root.
Please share a screenshot of your file structure.
@Barbary Lionwithout the file structure we can't help you