[
https://issues.apache.org/jira/browse/LOG4J2-3441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17533916#comment-17533916
]
Ralph Goers commented on LOG4J2-3441:
-------------------------------------
PatternConverter plugins define the pattern keys that trigger them. The full
list of pattern keys must be available the first time something is logged.
PatternParser's constructor creates a Map of the converter keys and the
PatternConverter Class the key maps to. During parsing PatternParser checks to
see if the Class implements specific interfaces so not having the classes
available would have a significant impact.
Note that a PatternParser is only instantiated when it is created by the
RollingFileAppender, PatternLayout or RFC5424Layout. So this is essentially
already lazily loaded.
This is a case where I don't believe there is any value in deferring creating
the class instances.
> Defer loading of StrLookup and PatternConverter plugin classes until first use
> ------------------------------------------------------------------------------
>
> Key: LOG4J2-3441
> URL: https://issues.apache.org/jira/browse/LOG4J2-3441
> Project: Log4j 2
> Issue Type: Improvement
> Components: Lookups, Pattern Converters, Plugins
> Reporter: Matt Sicker
> Assignee: Matt Sicker
> Priority: Major
>
> StrLookup and PatternConverter plugins are eagerly loaded at startup. At this
> point, these are a fairly large number of classes! If these plugins could be
> lazily loaded similar to how Core category plugins aren't loaded until first
> used in a configuration, that should shave off some startup time.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)