Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-72

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0-alpha2
    • 2.0-beta1
    • None
    • None
    • 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/

      Attachments

        Activity

          People

            rgoers Ralph Goers
            tgkprog Tushar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: