Skip to content

Provide service specific log4j overrides in containerized deployments - #13020

Merged
FrankChen021 merged 3 commits into
apache:masterfrom
a2l007:dockerlogs
Sep 14, 2022
Merged

FrankChen021 merged 3 commits into
apache:masterfrom
a2l007:dockerlogs

Conversation

@a2l007

@a2l007 a2l007 commented Sep 2, 2022

Copy link
Copy Markdown
Contributor

The existing druid script associated with the official Dockerfile provides support for altering log4j config present in the common config directory via env options. These options don't work for druid-operator based deployments since the operator pushes the log4j2 xml to the service specific directories by default.
This PR provides an option to override log4j configs setup at the service level directories so that it works with usecases similar to above.


This PR has:

  • been self-reviewed.
  • been tested in a test Druid cluster.

@a2l007 a2l007 added Area - Operations Docker https://hub.docker.com/r/apache/druid labels Sep 2, 2022

@capistrant capistrant left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one nit comment, but this seems like a useful idea in general

Comment thread distribution/docker/druid.sh Outdated
# - DRUID_LOG4J -- set the entire log4j.xml verbatim
# - DRUID_LOG_LEVEL -- override the default log level in default log4j
# - DRUID_SERVICE_LOG4J -- set the entire service specific log4j.xml verbatim
# - DRUID_SERVICE_LOG_LEVEL -- override the default log level in the service specific log4j

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want to note that this only works if the existing log level in the service log4j file is info

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Added the clarification.

@FrankChen021

Copy link
Copy Markdown
Member

@a2l007 oh, I forgot about the doc. It's better to document these new config in the docs/tutorials/docker.md since there's a Logging configuration section in that doc.

@a2l007

a2l007 commented Sep 13, 2022

Copy link
Copy Markdown
Contributor Author

@FrankChen021 Good catch, I've added the docs.

@FrankChen021
FrankChen021 merged commit a8fd3a9 into apache:master Sep 14, 2022
@kfaraz kfaraz added this to the 25.0 milestone Nov 22, 2022
riovic918data pushed a commit to riovic918data/druid that referenced this pull request Jun 12, 2026
…apache#13020)

* Provide service specific log4j overrides

* Clarify comments

* Add docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area - Operations Docker https://hub.docker.com/r/apache/druid

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants