Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak logging style to have everything on console and on disk in JSON #72538

Open
thbkrkr opened this issue Apr 30, 2021 · 3 comments
Open

Tweak logging style to have everything on console and on disk in JSON #72538

thbkrkr opened this issue Apr 30, 2021 · 3 comments
Labels
:Core/Infra/Logging Log management and logging utilities >enhancement Team:Core/Infra Meta label for core/infra team

Comments

@thbkrkr
Copy link
Contributor

thbkrkr commented Apr 30, 2021

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 with ES_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?

@thbkrkr thbkrkr added >enhancement needs:triage Requires assignment of a team area label labels Apr 30, 2021
@DJRickyB DJRickyB added :Core/Infra/Logging Log management and logging utilities and removed needs:triage Requires assignment of a team area label labels May 3, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label May 3, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@pgomulka
Copy link
Contributor

we discussed this on 12may es-delivery sync.
I think this is a good idea. We could support ES_LOG_STYLE=file to also log to a file? Would this be fine by cloud @elastic/cloud-delivery ?
Otherwise we could add a third option both/tee
Or we could allow to set ES_LOG_STYLE with both values - not sure how complex it would be, but some work would be required.

cc @elastic/es-delivery

@thbkrkr
Copy link
Contributor Author

thbkrkr commented May 12, 2021

@pgomulka Thank you for looking into that!

We could support ES_LOG_STYLE=file to also log to a file?

Did you mean ES_LOG_STYLE=docker because ES_LOG_STYLE=file already logs to a file?

Would this be fine by cloud @elastic/cloud-delivery?

I don't know how interested @elastic/cloud-delivery is in this enhancement. The ECK team has a separate alias: @elastic/cloud-k8s. 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Logging Log management and logging utilities >enhancement Team:Core/Infra Meta label for core/infra team
Projects
None yet
Development

No branches or pull requests

4 participants