Skip to content

Capture Crashes in Logs #550

@otobot1

Description

@otobot1

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions