Elasticsearch Log deletion not happening as per defined days in log4j.pproperties file

Dear Team,

We are facing an issue where Elasticsearch logging with log4j2.properties not performing the log rotation on the basis of lfLastmodified age condition, we want to rotate the logs every after 7days but it is not working.

It would be great to get help on this issue, is there anything we can correct to make it working.

Elasticsearch version 7.14.1

Following are the configuration details from log4j2.properties.

############json logs#########################
appender.rolling.strategy.action.ifAny.type = IfAny
appender.rolling.strategy.action.ifAny.ifLastModified.type = IfLastModified
appender.rolling.strategy.action.ifAny.ifLastModified.age = 7D
appender.rolling.strategy.action.ifAny.ifAccumulatedFileSize.type = IfAccumulatedFileSize
appender.rolling.strategy.action.ifAny.ifAccumulatedFileSize.exceeds = 2GB

######## Server - old style pattern ###########
appender.rolling_old.strategy.action.ifAny.type = IfAny
appender.rolling_old.strategy.action.ifAny.ifLastModified.type = IfLastModified
appender.rolling_old.strategy.action.ifAny.ifLastModified.age = 7D
appender.rolling_old.strategy.action.ifAny.ifAccumulatedFileSize.type = IfAccumulatedFileSize
appender.rolling_old.strategy.action.ifAny.ifAccumulatedFileSize.exceeds = 2GB

##############################################

Thank you in advance

Regards
Pratiksha

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.