Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include backtrace when logger.exception(...) is called. #1181

Open
philomory opened this issue Jul 17, 2024 · 1 comment
Open

Include backtrace when logger.exception(...) is called. #1181

philomory opened this issue Jul 17, 2024 · 1 comment

Comments

@philomory
Copy link

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

We are trying to get backtraces attached to our logged exceptions, the way they are in e.g. the Java agent. We log exceptions via e.g.

try:
  some_code()
except ExampleException:
  logger.exception("a message!")

In the console output for the application, this results in the full exception details being logged alongside the message, include the exception class, backtrace, etc. But New Relic only gets the exception message.

Feature Description

When the logger.exception(...) method of the standard library logging module is called, the exception details should be included in the Log event sent to New Relic.

Describe Alternatives

We can (and will have to) add newrelic.agent.notice_error(...) calls to all of our exception handlers, but, this feels like something that should not be necessary (and is actually a slightly different feature regardless, since that still doesn't attach the backtrace to the logs the way they ought to be).

Additional context

Python 3.8, New Relic Python Agent version 9.12.0, non-web process. All default configuration (except NEW_RELIC_APP_NAME, NEW_RELIC_LOG, NEW_RELIC_LABELS, NEW_RELIC_LICENSE_KEY. Tried setting NEW_RELIC_APPLICATION_LOGGING_FORWARDING_CONTEXT_DATA_ENABLED, but it did not have the desired effect.

Priority

Please help us better understand this feature request by choosing a priority from the following options:
Really Want

@workato-integration
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants