Skip to content

Feature enhancement (Logger): automatically intercept Runtime exceptions, and log information #1527

Closed
@mriccia

Description

@mriccia

Is your feature request related to a problem? Please describe.

When using the Powertools Logger, log lines are annotated with a number of useful fields such as function_request_id.
However, if a Runtime exception is thrown, Powertools Logger isn't used to log the exception. Instead the exception is printed using the System.err by the JVM, and the log lines do not contain any information relating to the function execution.

Describe the solution you'd like

I would like the RuntimeExceptions to be printed, so when exceptions are raised in my code, I can identify the function_request_id for further debugging

Describe alternatives you've considered

It is possible for Powertools users to define their own catching mechanism, however it would be nice if Powertools Logger printed this information by default

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    good-first-issueGood for newcomersloggerpriority:3Neutral - not a core feature or affects less than 40% of usersstatus/staged-major-releaseThis change will go with the next major releasev2Version 2

    Type

    No type

    Projects

    Status

    Coming soon

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions