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

DateLookup not parsed for FastRollingFile appender

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta8
    • Fix Version/s: 2.0-rc1
    • Component/s: Appenders
    • Labels:
      None
    • Environment:

      Operating System: Windows Server 2008 R2 SP1
      Java Runtime: 1.7.0_03-x64

      Description

      I'm trying to create a Log4j2 configuration file that will create a log file using DateLookup so that the current date and time are in the filename (so it matches the logging used in our other products). This is what the appender configuration looks like:

      <FastRollingFile name="Rolling" fileName="log/$${date:yyyyMMdd-HHmmss} - myApp.log" filePattern="log/$${date:yyyyMMdd-HHmmss} - myApp-%i.log">
      	<immediateFlush>true</immediateFlush>
      	<suppressExceptions>false</suppressExceptions>
      	<PatternLayout>
      		<pattern>%d %p %c{1.} [%t] $${env:USER} %m%n</pattern>
      	</PatternLayout>
      	<Policies>
      		<OnStartupTriggeringPolicy />
      		<SizeBasedTriggeringPolicy size="100 MB"/>
      	</Policies>
      </FastRollingFile>
      

      However when the log file is generated the filename is "${date". I've tried different variations and haven't been able to get this lookup to work at all.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mngoldeneagle Jesse Docken
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: