[
https://issues.apache.org/jira/browse/LOG4J2-2750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17005777#comment-17005777
]
Carter Kozak commented on LOG4J2-2750:
--------------------------------------
I agree that configuration in the configuration file is cleaner than global
properties, however I'm not sure how feasible that would be in this case
without breaking ThrowableProxy.
Unfortunately ThrowableProxy instances are created across several different
points in the logging lifecycle, so it's difficult to associate creation with a
configuration instance. I'm open to ideas if you have them :-)
I'm not sure this feature should be configurable per-element because it becomes
harder to ensure all components are performant. If my application uses complex
class loaders in a way that causes many cache misses and class loads, I'd like
to ensure that exceptions don't cause the application to block looking for data
that doesn't exist. That need lends itself better to system properties than
configuration, but the argument against is that the need is based on
performance pitfalls of our extended information lookup implementation which
could be improved to avoid the need. Unfortunately I'm not aware of a way to
avoid class loading synchronization without a potentially large memory cost
maintaining a persistent cache, which has its own problems and maintenance
burden.
> Setting to disable extended stack trace for layouts
> ---------------------------------------------------
>
> Key: LOG4J2-2750
> URL: https://issues.apache.org/jira/browse/LOG4J2-2750
> Project: Log4j 2
> Issue Type: Improvement
> Components: Layouts
> Reporter: Mikhail Talisov
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> By default almost all layouts use an extended stack trace output format
> (ExtendedStackTraceElement). Currently I can change the stack trace format in
> PatternLayout by specifiyng its template (%throwable, %xThrowable, etc). When
> specified %throwable then no class packaging information is included in
> output.
> But when I use for example JsonLayout or AsyncAppender with any layout then
> no way to exclude class packaging information from the stack trace (this mean
> class loading from classpath for all stack trace elements). For performance
> reason would be good to have a setting to disable extending the stack trace
> in layouts.
> It's possible to add new attribute "extendedStackTrace" (for example, which
> is true by default) in layout elements (except PatternLayout and some other
> layouts where no ThrowableProxyHelper#toExtendedStackTrace is using). When I
> set extendedStackTrace="false" then stack trace must be serialized without
> class loading for all stack trace elements. AsyncAppender must use refs
> appender layout's attribute.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)