elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.21k stars 24.85k forks source link

Issue in Elasticsearch Logging documentation #91885

Open Erni opened 1 year ago

Erni commented 1 year ago

Description

The documentation on website https://www.elastic.co/guide/en/elasticsearch/reference/7.16/logging.html should be updated.

Attached is the file that worked after testing and specially the below part is what worked with 7.16 version unlike what is mentioned on the website: log4j2.properties_latest.zip

> [#Strategies](javascript:srcUp('%2F_ui%2Fcore%2Fchatter%2Ftopics%2FTopicPage%3Fname%3DStrategies%26ref%3Dhash_mention%26isdtp%3Dvw');) determines when to delete these rolled(compressed) logs
> appender.rolling.strategy.type = DefaultRolloverStrategy
> [#Here](javascript:srcUp('%2F_ui%2Fcore%2Fchatter%2Ftopics%2FTopicPage%3Fname%3DHere%26ref%3Dhash_mention%26isdtp%3Dvw');) we state there is no maximum number of retained compressed logs
> appender.rolling.strategy.fileIndex = nomax
> [#We](javascript:srcUp('%2F_ui%2Fcore%2Fchatter%2Ftopics%2FTopicPage%3Fname%3DWe%26ref%3Dhash_mention%26isdtp%3Dvw');) dont want to keep logs or move them to another device, so we just delete them
> appender.rolling.strategy.action.type = Delete
> appender.rolling.strategy.action.basepath = ${sys:es.logs.base_path}
> [#We](javascript:srcUp('%2F_ui%2Fcore%2Fchatter%2Ftopics%2FTopicPage%3Fname%3DWe%26ref%3Dhash_mention%26isdtp%3Dvw');) set a compressed logs deleting strategy based on filenames
> appender.rolling.strategy.action.condition.type = IfFileName
> [#Feel](javascript:srcUp('%2F_ui%2Fcore%2Fchatter%2Ftopics%2FTopicPage%3Fname%3DFeel%26ref%3Dhash_mention%26isdtp%3Dvw');) free to set the regex which will suit you the best
> appender.rolling.strategy.action.condition.glob = ${sys:es.logs.cluster_name}-*
> [#Based](javascript:srcUp('%2F_ui%2Fcore%2Fchatter%2Ftopics%2FTopicPage%3Fname%3DBased%26ref%3Dhash_mention%26isdtp%3Dvw');) on log4j doc, ifAny allow to set logical OR between the next deleting compressed logs strategy conditions
> appender.rolling.strategy.action.condition.ifAny.type = IfAny
> ####################################################################
> [#Remember](javascript:srcUp('%2F_ui%2Fcore%2Fchatter%2Ftopics%2FTopicPage%3Fname%3DRemember%26ref%3Dhash_mention%26isdtp%3Dvw');) this condition is set based on filename so IfLastModified will check only the compressed logs name to determine if its modification date is older than the threshold we set. Unlike time.interval we have to set a time unit.
> #########################################################################################
> appender.rolling.strategy.action.condition.ifAny.ifLastModified.type = IfLastModified
> appender.rolling.strategy.action.condition.ifAny.ifLastModified.age = 1D
> [#This](javascript:srcUp('%2F_ui%2Fcore%2Fchatter%2Ftopics%2FTopicPage%3Fname%3DThis%26ref%3Dhash_mention%26isdtp%3Dvw');) condition states that if the summed size of compressed logs is above a stated value, the lowest incremented log file will be deleted
> appender.rolling.strategy.action.condition.ifAny.ifAccumulatedFileSize.type = IfAccumulatedFileSize
> appender.rolling.strategy.action.condition.ifAny.ifAccumulatedFileSize.exceeds = 1GB
elasticsearchmachine commented 1 year ago

Pinging @elastic/es-docs (Team:Docs)