Details
Description
Using sample config for RollingRandomAccessFile, with log name retrieved from enviroment variable "Fubar"...
<RollingRandomAccessFile name="RollingRandomAccessFile" fileName="logs/${sys:Fubar}.log" filePattern="logs/$${date:yyyy-MM-dd}/${sys:Fubar}-%d{MM-dd-yyyy}-%i.log.gz">
Along with a harness program,
public static void main(String[] args) { for (int i=0; i < 100000; i++) { logger.info("Logger writes message for the nth time " + i); } System.out.println("Done"); }
If I use ${sys:Fubar}, instead of, say a literal value, the contents of the first rolled file are lost. I had SizeBasedTriggeringPolicy set to 1 MB, meaning, 21296 log messages were lost.
Attachments
Issue Links
- is related to
-
LOG4J2-531 Rolled log files overwritten by RollingFile appender with composite time and size based policies
- Closed