[ https://issues.apache.org/jira/browse/LOG4J2-3115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17379848#comment-17379848 ]
Markus Spann commented on LOG4J2-3115: -------------------------------------- Please note: a discussion on this feature is taking place at the [PR 544|https://github.com/apache/logging-log4j2/pull/544] on Github. > Remember previously computed strings in NamePatternConverter > ------------------------------------------------------------ > > Key: LOG4J2-3115 > URL: https://issues.apache.org/jira/browse/LOG4J2-3115 > Project: Log4j 2 > Issue Type: Improvement > Components: Core > Reporter: Markus Spann > Priority: Minor > > Implementations of {{NamePatternConverter}} are responsible for abbreviating > logger and class names according to a configured pattern. > Abbreviation can be quite complex and computationally expensive (consider > abbreviating x parts of a fully qualified class name to y number of leftmost > characters). > Example: > The pattern {{%logger\{1.}}} abbreviates logger name > {{org.apache.logging.log4j.core.pattern.NameAbbreviator}} to > {{o.a.l.l.c.p.NameAbbreviator}} > The strings to abbreviate (logger and class names) extremely likely stem from > a limited set of candidates. I would like to suggest that results are cached > to prevent computation over and over again e.g. in every log statement of a > logger. > I have a small patch ready that addresses the issue. -- This message was sent by Atlassian Jira (v8.3.4#803005)