-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Include the default log4j config in Docker images #62758
Comments
Pinging @elastic/es-core-infra (:Core/Infra/Logging) |
I spent some time time thinking about this. I did consider whether we should simply stop tailoring logging for Docker in v8.0. This would be a simple solution, but users relying on the current logging arrangement would then have to recreate it themselves. Logging to stderr / stdout remains the expected default behaviour in the Docker world. So then I wondered about shipping a There's also the question of whether it's possible to automatically generate a Docker |
One other possibility would be to convert the standard logging config to a docker-style config at runtime. While more complex, this would pick up any log configurations for installed plugins as well. Making this work in practise would likely be tricky, however. |
In the course of looking into this, I started wondering if we should make it possible to direct GC logs to stderr, instead of to file as we do at present. It's a separate concern, and I think we'd need to make it opt-in because the usual settings that we apply result in a lot of logs, and stderr obviously has no file rotation. |
Closes elastic#62758. Include the Stack log4j config in the Docker image, in order to make it possible to write logs in a container environment in the same way as for an archive or package deployment. This is useful in situations where the user is bind-mounting the logs directory and has their own arrangements for log shipping.
Closes #62758. Include the Stack log4j config in the Docker image, in order to make it possible to write logs in a container environment in the same way as for an archive or package deployment. This is useful in situations where the user is bind-mounting the logs directory and has their own arrangements for log shipping. To use stack logging, set the environment variable `ES_LOG_STYLE` to `file`. It can also be set to `console`, which is the same as not specifying it at all. The Docker logging config is now auto-generated at image build time, by running the default config through a transformer program when preparing the distribution in an image builder step. Also, in the docker distribution `build.gradle`, I changed a helper closure into a class with a static method in order to fix an issue where the Docker image was always being rebuilt, even when there were no changes.
Backport of elastic#65778. Closes elastic#62758. Include the Stack log4j config in the Docker image, in order to make it possible to write logs in a container environment in the same way as for an archive or package deployment. This is useful in situations where the user is bind-mounting the logs directory and has their own arrangements for log shipping. To use stack logging, set the environment variable `ES_LOG_STYLE` to `file`. It can also be set to `console`, which is the same as not specifying it at all. The Docker logging config is now auto-generated at image build time, by running the default config through a transformer program when preparing the distribution in an image builder step. Also, in the docker distribution `build.gradle`, I changed a helper closure into a class with a static method in order to fix an issue where the Docker image was always being rebuilt, even when there were no changes.
Backport of #65778. Closes #62758. Include the Stack log4j config in the Docker image, in order to make it possible to write logs in a container environment in the same way as for an archive or package deployment. This is useful in situations where the user is bind-mounting the logs directory and has their own arrangements for log shipping. To use stack logging, set the environment variable `ES_LOG_STYLE` to `file`. It can also be set to `console`, which is the same as not specifying it at all. The Docker logging config is now auto-generated at image build time, by running the default config through a transformer program when preparing the distribution in an image builder step. Also, in the docker distribution `build.gradle`, I changed a helper closure into a class with a static method in order to fix an issue where the Docker image was always being rebuilt, even when there were no changes.
At present we ship a custom log4j configuration in our Docker images. This done to make the images more "Docker-like", since the convention with Docker is to write all container output to stdout and stderr.
This is not ideal, because:
event.dataset
valueElasticsearch should make it easy to pick what style of logging to use in Docker. Ideally, the stdout/stderr logging config should be automatically derived from the default configs, so as to minimise drift.
The text was updated successfully, but these errors were encountered: