Manage logs files of elasticsearch

Hi,

Elasticsearch create log file for graylog (for me, it’s in /var/lib/elasticsearch/log/)

Where it’s manage ? (log4j ?)
Because I would like to delete log files longer than 7 days.

I can create a script but if it is used elsewhere…

Regards

hi,
You can use this page to help you:

https://www.elastic.co/guide/en/elasticsearch/reference/master/logging.html

Of have logrotate to manage this:

Thank you.
I added that on log4j2.properties

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 = IfFileName appender.rolling.strategy.action.condition.glob = {sys:es.logs.cluster_name}-*
appender.rolling.strategy.action.condition.nested_condition.type = IfLastModified
appender.rolling.strategy.action.condition.nested_condition.age = 7D

It’s running fine.

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