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

ASF GitHub Bot commented on LOG4J2-2365:
----------------------------------------

Github user undefz commented on the issue:

    https://github.com/apache/logging-log4j2/pull/188
  
    @rgoers Could you please review this pull request?
    I believe your original logic was broken when implementing LOG4J-1321


> NameAbbreviator skips first fragments
> -------------------------------------
>
>                 Key: LOG4J2-2365
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2365
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Pattern Converters
>    Affects Versions: 2.11.0
>            Reporter: Eugene Zimichev
>            Priority: Major
>
> When I use LoggernPatternConverter in beginning of my layout it outputs as 
> expected
> {code:java}
> <PatternLayout pattern="%c{1.1.*} %date{HH:mm:ss.SSS} %-5level %-25thread| 
> %msg%n%xThrowable"/>{code}
> {code:java}
> c.k.zoo.CuratorEnsembleProvider 16:48:13.175 INFO main | Connecting to 
> ensemble on [localhost]:8080{code}
>  However when I move converter to the end of the layout it stops abbreviating 
> logger name parts.
> {code:java}
> <PatternLayout pattern="%date{HH:mm:ss.SSS} %-5level %-25thread| %c{1.1.*} 
> %msg%n%xThrowable"/>{code}
> {code:java}
> 16:47:38.687 INFO main | com.kamagames.zoo.CuratorEnsembleProvider Connecting 
> to ensemble on [localhost]:8080{code}
>  
> I believe it's caused by code in NameAbbreviator which stops processing first 
> pattern fragments when abbreviated string length is larger than current 
> position in StringBuilder
>  
> {code:java}
> for (int i = 0; i < fragments.length - 1 && pos < original.length(); i++) {
>  pos = fragments[i].abbreviate(sb, pos);
> } {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to