Skip to content

Conversation

@jlopezinc
Copy link

Include full exception stack trace

Only supported on logback

You can configure the logging extension to include in error.stack the full stack trace just like the downstream library does.
This includes the caused by chain.

As an example, this snippet:

Exception inner2 = new IllegalAccessException("test caused by 2");
Exception inner1 = new RuntimeException("test caused by 1", inner2);
LOGGER.error("failed for test!", new RuntimeException("test exception", inner1));

Will set the error.stack as

java.lang.RuntimeException: test exception
    at (regular stacktrace)
    at ...
Caused by: java.lang.RuntimeException: test caused by 1
	... 49 common frames omitted
Caused by: java.lang.IllegalAccessException: test caused by 2
	... 49 common frames omitted

Default is false for retro-compatibility.

This setting can be enabled via environment variable (NEW_RELIC_LOG_EXTENSION_INCLUDE_FULL_ERROR_STACK=true) or system variable (-Dnewrelic.log_extension.include_full_error_stack=true).

Be aware that enabling this setting will use the downstream library's stacktrace generation, not taking in consideration
the value of Exception Stack Trace Size.

@CLAassistant
Copy link

CLAassistant commented Jul 13, 2023

CLA assistant check
All committers have signed the CLA.

@jlopezinc jlopezinc force-pushed the include-full-error-stack branch from a57ba6e to fef280e Compare July 13, 2023 16:13
Copy link

@trico-tillster trico-tillster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@kbford56 kbford56 added the estimate Issue needing estimation label Jul 18, 2023
@kbford56 kbford56 added oct-dec qtr Represents proposed work item for the Oct-Dec quarter 2w Estimate - two weeks or less and removed estimate Issue needing estimation labels Sep 20, 2023
@jtduffy
Copy link
Contributor

jtduffy commented Oct 16, 2023

Closing - fixed by #82

@jtduffy jtduffy closed this Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2w Estimate - two weeks or less oct-dec qtr Represents proposed work item for the Oct-Dec quarter

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants