Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
None
-
Important
Description
The configuration is not resolved when file rolls over at the end/start of the day.
Expected: when the file rolls over, I would expect that the variables in fileName configuration would be resolved again to its current values and a new file created in a folder for the current day. I.e. the logs are always written to the directory for the current date.
Actual: logging continues using the file that was created at startup. I.e. in the folder for the day the application was started.
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Appenders>
<RollingRandomAccessFile name="File"
fileName="c:/temp/${date:yyyyMMdd}/App-${date:yyyyMMdd_HHmmss}.log"
filePattern="c:/temp/$${date:yyyyMMdd}/App-%d
-%i.log.zip"
immediateFlush="false"
append="true">
<PatternLayout>
<Pattern>%-5p %d
[%t] [%c
{1}] (%F:%L) - %m %n</Pattern>
</PatternLayout>
<Policies>
<OnStartupTriggeringPolicy />
<TimeBasedTriggeringPolicy />
</Policies>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="File" />
</Root>
</Loggers>
</Configuration>
Attachments
Attachments
Issue Links
- is related to
-
LOG4J2-239 RollingFileAppender should support logging directly to the file referenced in the filePattern.
- Closed