The configuration file of Log4j 2 is shown below,the following XML fragment defines policies that rollover the log when the log size reaches hundred megabytes
<RollingFile name="service" fileName="${log_path}/service/FDI.log"
filePattern="${log_path}/service/$${date:yyyyMMdd}/proc-FDI-service-${env:HOST_IP}-%d{yyyyMMdd}-%i.log.zip"
filePermissions="rwxrwxrwx"
>
<PatternLayout>
<Pattern>%d [%t] [%X{FLOWNO}] [%X{IP}] (%c.%M:%L) [%-5p] - %m%n</Pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
<SizeBasedTriggeringPolicy size="100MB"/>
</Policies>
<DefaultRolloverStrategy max="999" compressionLevel="9"/>
</RollingFile>
Indeed, a compressed file was generated.
Why still is it 100MB after compression?
-rwxrwxrwx 1 dcits dcits 101M Jan 16 17:00 proc-FDI-service--20220116-3.log.zip