[ 
https://issues.apache.org/jira/browse/LOG4J2-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17627820#comment-17627820
 ] 

Jannik Zuther commented on LOG4J2-2785:
---------------------------------------

I also hope that this is still going to happen, at some point! It feels like 
the last puzzle piece to really give you all of the flexibility to customize 
the logger names exactly how you want them to be.
With Java package names often being extremely long, shortening is really 
helpful for making logs more readable and also save some space if you store the 
logs. But just cutting off parts doesn't feel right. Being able to shorten a 
part of the name and keeping the rest at full length is a good compromise.

> Pattern Layout to abbreviate the name of all logger components except the 2 
> rightmost
> -------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-2785
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2785
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Layouts
>            Reporter: Rahul Khimasia
>            Assignee: Ralph Goers
>            Priority: Minor
>
> The following are my favorite patterns
> {quote}%c\{2} - which displays the corresponding number of rightmost logger 
> name components. So a logger with a name like "org.apache.commons.Foo" is 
> displayed as "commons.Foo".
> {quote}
> and
> {quote}%c\{1.} - which abbreviates the name based on the pattern. So a logger 
> with a name like "org.apache.commons.Foo" is displayed as "o.a.c.Foo".
> {quote}
> Is there a way to combine the two. I want to abbreviate the name of all 
> logger components except the 2 rightmost. Such that "org.apache.commons.Foo" 
> is displayed as "o.a.commons.Foo".



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to