Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
The feature for using dates as part of the current logfile (by omitting the filename attribute and using the filepattern instead) has been implemented for RollingFileAppender (see LOG4J2-1101) but not for RollingRandomAccessFileAppender.
The following config should work:
<RollingRandomAccessFile name="Application" filePattern="logs/test.%d{yyyy-MM-dd-HH-mm}.log"> <PatternLayout pattern="%d{DATE} [%p] %X{RequestId} (%t) %c: %m%n"/> <Policies> <TimeBasedTriggeringPolicy interval="1" modulate="true"/> </Policies> <DirectWriteRolloverStrategy/> </RollingRandomAccessFile>
Currently it emits
ERROR No filename was provided for FileAppender with name Application
Attachments
Issue Links
- is related to
-
LOG4J2-1101 Date based file appender
- Resolved