logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-621) Pattern To Drop First X Package Parts
Date Thu, 28 Apr 2016 22:06:13 GMT

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

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

Github user garydgregory commented on the pull request:

    https://github.com/apache/logging-log4j2/pull/28#issuecomment-215576984
  
    Thank you,
    
    I should be able to this tomorrow.
    
    Gary
    
    On Wed, Apr 27, 2016 at 11:23 AM, Kamal Mettananda <notifications@github.com
    > wrote:
    
    > Updated site content looks as below.
    >
    > [image: log4j2-621_site_update]
    > <https://cloud.githubusercontent.com/assets/1687033/14863352/fd6a3b86-0cd2-11e6-937a-0e1cf6f2d120.JPG>
    >
    > —
    > You are receiving this because you were mentioned.
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/logging-log4j2/pull/28#issuecomment-215181472>
    >
    
    
    
    -- 
    E-Mail: garydgregory@gmail.com | ggregory@apache.org
    Java Persistence with Hibernate, Second Edition
    <http://www.manning.com/bauer3/>
    JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
    Spring Batch in Action <http://www.manning.com/templier/>
    Blog: http://garygregory.wordpress.com
    Home: http://garygregory.com/
    Tweet! http://twitter.com/GaryGregory



> Pattern To Drop First X Package Parts
> -------------------------------------
>
>                 Key: LOG4J2-621
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-621
>             Project: Log4j 2
>          Issue Type: Wish
>          Components: Layouts
>    Affects Versions: 2.0-rc1
>            Reporter: Lee Theobald
>            Priority: Trivial
>         Attachments: LOG4J2-621_01.patch
>
>
> Currently you can have a pattern that will print out the last X parts of you package.
 So if my package was {{uk.co.ltheobald.foo.bar}}, then using {{%logger\{2\}}} will print
{{foo.bar}}.  But when I have a number of different package levels, this becomes less useful
(in my opinion).
> What I'd find more useful is the inverse where I can ditch the first X parts.  Something
like {{%logger\{-3\}}} for example.  That way I'd end up with:
> {{uk.co.ltheobald.Main logging}} as {{Main}}
> {{uk.co.ltheobald.foo.MyClass}} logging as {{foo.MyClass}}
> {{uk.co.ltheobald.foo.bar.MyOtherClass}} logging as {{foo.bar.MyOtherClass}}
> Removing from the start of the logger name allows me to consistently trim off package
names that I know are always the same.  I'll see if I can produce a code example for this
if I get time but I wanted to log it in the meanwhile.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message