Restrict the number of log files

(Achim Weigel) #1


we are using Elasticsearch 1.6 and have configured in the logging.yml a logger which compresses a log file when it achieves a maximal size of 100KB:

type: extrasRollingFile
file: ${path.logs}/${}.log
rollingPolicy: timeBased
rollingPolicy.FileNamePattern: ${path.logs}/${}_%i.log.%d{yyyy-MM-dd}.gz
triggeringPolicy.MaxFileSize: 100KB
type: pattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"

Is it also possible to add some configuration such that old compressed log files are removed e.g. after 14 days? We tried the parameter MaxBackupIndex but it was not accepted by Elasticsearch - perhaps we just do not know the syntax how to add it.

Thank you very much and best Regards.


@achimweigel - Did you figure this out or did you have to use a different or custom appender?

(Achim Weigel) #3

Unfortunately not. We decided to configure the logging by adapting the logging.yml file, i.e. we restricted the size and max number of the different log files. Furthermore we commented out the following log files in the ES config.yml:

index.indexing.slowlog.threshold.index.warn: 10s 5s
index.indexing.slowlog.threshold.index.debug: 2s
index.indexing.slowlog.threshold.index.trace: 500ms


Thanks for the info - we'll likely end up doing the same

(system) #5