You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2013/09/03 19:55:52 UTC

[jira] [Resolved] (LOG4J2-383) [Pattern Layout] Customize level name by length

     [ https://issues.apache.org/jira/browse/LOG4J2-383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory resolved LOG4J2-383.
---------------------------------

    Resolution: Fixed

{noformat}
commit -m "[LOG4J2-383][Pattern Layout] Customize level name by length." C:/vcs/svn/apache/log4j2/trunk/src/changes/changes.xml C:/vcs/svn/apache/log4j2/trunk/src/site/xdoc/manual/layouts.xml.vm C:/vcs/svn/apache/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java C:/vcs/svn/apache/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/LevelPatternConverterTest.java
    Sending        C:/vcs/svn/apache/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java
    Sending        C:/vcs/svn/apache/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/LevelPatternConverterTest.java
    Sending        C:/vcs/svn/apache/log4j2/trunk/src/changes/changes.xml
    Sending        C:/vcs/svn/apache/log4j2/trunk/src/site/xdoc/manual/layouts.xml.vm
    Transmitting file data ...
    Committed revision 1519760.
{noformat}

                
> [Pattern Layout] Customize level name by length
> -----------------------------------------------
>
>                 Key: LOG4J2-383
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-383
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Layouts
>         Environment: Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 08:51:28-0500)
> Maven home: C:\Java\apache-maven-3.0.5\bin\..
> Java version: 1.7.0_25, vendor: Oracle Corporation
> Java home: C:\Program Files\Java\jdk1.7.0_25\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>            Reporter: Gary Gregory
>            Assignee: Gary Gregory
>             Fix For: 2.0-beta9
>
>
> The level in a pattern layout can be defined as:
> {noformat}
> %level{length=n}
> {noformat}
> For example:
> {noformat}
> %level{length=1}
> {noformat}
> Which will give you log level names:
> - I for Info
> - W for Warning
> - D for Debug
> - and so on.
> If n is greater than a level name length, the length of the level name is used.
> Note that the level name computation is done when the pattern is created, thus having no impact on logging performance.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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