I have a log4j2.xml which is rolling out 2 files one of which is a trace log file, that trace log file is rolled out size based and the limit is 10 MB. But I deleted the trace log file before it reached its limit. My question is, shouldn't it make a trace log file after I deleted it ?
Here is my configuration file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Configuration status="WARN">
<Properties>
<Property name="log-path">filepath to logs</Property>
</Properties>
<Appenders>
<RollingFile fileName="${log-path}/Splunk-${date:yyyy-MM-dd}.log"
filePattern="${log-path}/Splunk-%d{yyyy-MM-dd}.log"
name="info-log">
<Filters>
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
<PatternLayout>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %msg%n</pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
</RollingFile>
<RollingFile fileName="${log-path}/Splunk-trace.log"
filePattern="${log-path}/SplunkOADC-trace-%d{yyyy-MM-dd}.log"
name="trace-log">
<Filters>
<ThresholdFilter level="info" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="fatal" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
<ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY"/>
<ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/>
<ThresholdFilter level="FATAL" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
<PatternLayout>
<pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n</pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="10 MB"/>
</Policies>
</RollingFile>
</Appenders>
<Loggers>
<Logger level="all" name="Package-Name">
<AppenderRef ref="info-log"/>
<AppenderRef ref="trace-log"/>
</Logger>
<Root></Root>
</Loggers>
</Configuration>
Also my question is that my info log should be generated date wise. I have set TimeBasedTriggeringPolicy as "1". But I think it will calculate 24 hours after the file is created. I dont want that. How do I achieve that ?