-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Is your feature request related to a problem? Please describe.
The logger does not currently log uncaught exceptions limiting its usefulness in production.
Describe the solution you'd like
Capture uncaught exceptions in the logs. Because Next.js
catches most errors and simply emits them to stdout
/stderr
in a non-JSON format, we will also likely need to patch the Next.js
logger functions. We will also likely need to patch the built-in console
object, as Next.js
emits some logs there as well. See this article for more info - don't assume the code will just work though, as it is >2 years old.
Describe alternatives you've considered
We may be able to simply use next-logger instead. I haven't had a chance to dig into it, but at a glance it seems to be a robust solution. If nextLogger
does work, I would prefer to use it over a manual patch as it seems to be actively maintained.
Additional context
Follow-up to #548.