Tweak logging style to have everything on console and on disk in JSON #72538
Labels
:Core/Infra/Logging
Log management and logging utilities
>enhancement
Team:Core/Infra
Meta label for core/infra team
On ECK, we investigate a simple way that allows users to enable Stack monitoring in restricted Kubernetes environments. This means extracting log and stack monitoring metrics without the need for elevated permission or the ability to deploy DaemonSets in a Kubernetes environment. In this context, we want to run filebeat in a sidecar container configured to ship Elasticsearch log files. Related issue: elastic/cloud-on-k8s#4183.
There is a convenient way to enable disk logging with the recent addition of #62758 by setting
ES_LOG_STYLE=file
but this comes with the "drawback" of changing which logs and with what layout there are written to the console, compared to what we have withES_LOG_STYLE=docker
.Today, by default, ECK users are used to having all logs on the console in JSON (current behaviour provided by
ES_LOG_STYLE=docker
). We don't want to break this.In short, we would like to keep all logs written to the console in JSON and also log everything to disk.
We could achieve that by providing our custom log4j configuration but ideally we would prefer that ECK not handle this. Especially because there may be differences depending on the versions of Elasticsearch.
Do you think that another style of logging could be possible, or that the style of logging could be more easily configurable?
The text was updated successfully, but these errors were encountered: