Details
-
Bug
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
2.17.1
-
None
-
None
Description
One of our applications is using log4j2 version 2.17.1 with slf4j.
Here we are facing issue of logging of logs in the older date files like logs which should go to 19-july-2023 those are actually getting logged in 18-july-2023.
Lately also observed that it is logging logs of 8-aug-2023 logs in 3-aug-2023 file.
we have tried setting timezone as well but still the issue persists, following is the configuration for the same.
<properties>
<property name="log4j.rootLogger.timezone" value="CDT" />
</properties>
Here is the appender configuration in log4j2.xml,
<EcwRollingRandomAccessFile name="FILE" fileName="${sys:pathfile}/${date:yyyy-MM-dd}.log" filePattern="${sys:pathfile}/%d{yyyy-MM-dd}.log.gz" immediateFlush="true" append="true"> <PatternLayout pattern="%-5p | %d{yyyy-MM-dd HH:mm:ss zzz} | ${sys:AppVer} | [%t] %C{2} (%F:%L) - %m | %X%n" /> <Policies> <TimeBasedTriggeringPolicy interval="1" modulate="true" /> </Policies> <DefaultRolloverStrategy> <Delete basePath="${sys:pathfile}"> <IfFileName glob="//*.log.gz" /> <IfLastModified age="60d" /> </Delete> </DefaultRolloverStrategy> </EcwRollingRandomAccessFile>
Here is the list of jars we are using in our application.
log4j-api-2.17.1.jar
log4j-core-2.17.1.jar
log4j-slf4j-impl-2.17.1.jar
slf4j-api-1.7.36.jar
Please check attached screenshot of logs.
Could you please suggest let us know and suggest the solution around it?