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 "Ralph Goers (JIRA)" <ji...@apache.org> on 2012/08/31 05:29:07 UTC
[jira] [Commented] (LOG4J2-72) RollingFile with
filePattern="logs/app-%d{MM-dd-yyyy}.log"
[ https://issues.apache.org/jira/browse/LOG4J2-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13445597#comment-13445597 ]
Ralph Goers commented on LOG4J2-72:
-----------------------------------
The NullPointerException was caused by the filePattern not ending in .gz or .zip so no asynchronous action is created to compress the file.
> RollingFile with filePattern="logs/app-%d{MM-dd-yyyy}.log"
> ----------------------------------------------------------
>
> Key: LOG4J2-72
> URL: https://issues.apache.org/jira/browse/LOG4J2-72
> Project: Log4j 2
> Issue Type: Bug
> Affects Versions: 2.0-alpha2
> Environment: all
> Reporter: Tushar
> Priority: Minor
> Fix For: 2.0-alpha3
>
>
> Conf
> <?xml version="1.0" encoding="UTF-8"?>
> <configuration status="debug">
> <appenders>
> <Console name="Console" target="SYSTEM_OUT">
> <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
> </Console>
>
> <RollingFile name="Rolling-1" fileName="logs/a.log"
> filePattern="logs/app-%d{MM-dd-yyyy}.log">
> <PatternLayout>
> <pattern>%d %p %C [%t] %m%n</pattern> <!-- %d %p %C{1.} [%t] %m%n -->
> </PatternLayout>
>
>
> <Policies >
> <SizeBasedTriggeringPolicy size="5 mb" />
> <OnStartupTriggeringPolicy />
> </Policies>
> </RollingFile>
>
> </appenders>
> <loggers>
> <root level="debug">
> <appender-ref ref="Console"/>
> <appender-ref ref="Rolling-1"/>
> </root>
> </loggers>
> </configuration>
> First run okay.
> Second and subsequent runs
> 01:07:47.601 [main] ERROR com.s2n.log4j2.app1.Mn - start er Fri Aug 31 01:07:47 IST 2012
> 01:07:47.619 [main] INFO com.s2n.log4j2.app1.t.Two - info
> Exception in thread "Thread-0" java.lang.NullPointerException01:07:47.634 [main] DEBUG com.s2n.log4j2.app1.t.Two - debug
> 01:07:47.646 [main] ERROR com.s2n.log4j2.app1.t.Two - err
> at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$AsyncAction.execute(RollingFileManager.java:188)
> at org.apache.logging.log4j.core.appender.rolling.helper.ActionBase.run(ActionBase.java:63)
> at java.lang.Thread.run(Thread.java:662)
> Src code is at http://sel2in.com/pages/log4j/
--
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