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 "Remko Popma (JIRA)" <ji...@apache.org> on 2014/08/10 10:35:12 UTC

[jira] [Resolved] (LOG4J2-726) logging hang when PatternLayout's pattern has miss pattern

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

Remko Popma resolved LOG4J2-726.
--------------------------------

    Resolution: Fixed

Fixed in revision 1617062.
Please verify and close.

> logging hang when PatternLayout's pattern has miss pattern
> ----------------------------------------------------------
>
>                 Key: LOG4J2-726
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-726
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Configurators
>    Affects Versions: 2.0
>         Environment: windows 8.1 64bit
> java 1.7.0_55 64bit 
> log4j2 2.0
>            Reporter: moonumi
>            Assignee: Remko Popma
>             Fix For: 2.0.2
>
>
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration status="WARN">
>   <Appenders>
>     <Console name="Console" target="SYSTEM_OUT">
>       <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
>     </Console>
>   </Appenders>
>   <Loggers>
>     <Logger name="com.foo.Bar" level="trace" additivity="false">
>       <AppenderRef ref="Console"/>
>     </Logger>
>     <Root level="error">
>       <AppenderRef ref="Console"/>
>     </Root>
>   </Loggers>
> </Configuration>
> {code}
> The above configuration syntax is correct. However, if one makes a mistake and instead writes:
> {code}
> <PatternLayout pattern="%d\{HH:mm:ss.SSS  [%t] %-5level %logger\{36\} - %msg%n"/>
> {code}
> Note the ommited character "\}" in the date pattern.
> Run sample application.
> This will hang log4j2 logging system.
> sample source code:
> {code}
> import org.apache.logging.log4j.LogManager;
> import org.apache.logging.log4j.Logger;
>  
> public class HelloWorld {
>     private static Logger logger = LogManager.getLogger("HelloWorld");
>     public static void main(String[] args) {
>         logger.info("Hello, World!");
>     }
> }
> {code}
> appear pattern configuration error or logging print miss pattern.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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