Log4j 2
  1. Log4j 2
  2. LOG4J2-72

RollingFile with filePattern="logs/app-%d{MM-dd-yyyy}.log"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0-alpha2
    • Fix Version/s: 2.0-beta1
    • Component/s: None
    • Labels:
      None
    • Environment:

      all

      Description

      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/

        Activity

        Tushar created issue -
        Hide
        Ralph Goers added a comment -

        The NullPointerException was caused by the filePattern not ending in .gz or .zip so no asynchronous action is created to compress the file.

        Show
        Ralph Goers added a comment - The NullPointerException was caused by the filePattern not ending in .gz or .zip so no asynchronous action is created to compress the file.
        Hide
        Ralph Goers added a comment -

        Fix committed in revision 1379273

        Show
        Ralph Goers added a comment - Fix committed in revision 1379273
        Ralph Goers made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Ralph Goers [ ralph.goers@dslextreme.com ]
        Fix Version/s 2.0-alpha3 [ 12323246 ]
        Resolution Fixed [ 1 ]
        Tushar made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Ralph Goers
            Reporter:
            Tushar
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development