Log4j2 questions

Hello folks

I'd like to update the /etc/elasticsearch/log4j2.properties to automatically prune log files.

I followed some advice I read about here: https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html#logging

I added the following stanza to log4j2.properties, expecting existing "old" log files to be purged.

appender.rolling.strategy.type = DefaultRolloverStrategy 
appender.rolling.strategy.action.type = Delete 
appender.rolling.strategy.action.basepath = ${sys:es.logs.base_path} 
appender.rolling.strategy.action.condition.type = IfLastModified 
appender.rolling.strategy.action.condition.age = 7D 
appender.rolling.strategy.action.PathConditions.type = IfFileName 
appender.rolling.strategy.action.PathConditions.glob = ${sys:es.logs.cluster_name}-*

Unfortunately... nothing happened in the past 18 hours. I have months of log files lingering. Am I doing something wrong?

Questions:

  1. Should this stanza have resulted in purging all but the last 7 days of cluster logs?
  2. Do I need to restart Elasticsearch or some other service?

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