From c7b2d81a8f9f5d42af9f7210865953824767c9cb Mon Sep 17 00:00:00 2001 From: YeonKyung Ryu Date: Mon, 3 Aug 2026 23:08:07 +0900 Subject: [PATCH] [ZEPPELIN-6459] Align Docker image logging config and docs with Log4j2 DockerInterpreterProcess uploaded log4j.properties and log4j_yarn_cluster.properties to interpreter containers but never log4j2.properties, even though bin/common.sh looks for it via -Dlog4j.configurationFile for every local interpreter process. Add it to the transferred file list and align docs/quickstart/docker.md's file list with the code. Investigation showed the ticket's premise that log4j.properties is obsolete Log4j 1.x cruft doesn't hold: Zeppelin's default SLF4J binding is slf4j-reload4j, so log4j.properties is still the primary logging config. log4j2.properties exists only for Flink's bundled real Log4j2 core. Document this in scripts/docker/zeppelin/bin/Dockerfile so the multiple log4j* COPY lines aren't mistaken for duplicates again, and clarify in docs/setup/deployment/docker.md that ZEPPELIN_IN_DOCKER applies to that all-in-one image, not the split zeppelin-server/ zeppelin-interpreter images. Co-Authored-By: Claude Sonnet 5 --- docs/quickstart/docker.md | 3 ++- docs/setup/deployment/docker.md | 6 ++++++ scripts/docker/zeppelin/bin/Dockerfile | 5 +++++ .../interpreter/launcher/DockerInterpreterProcess.java | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/quickstart/docker.md b/docs/quickstart/docker.md index 17e6229d7bd..5ae3afcc3b5 100644 --- a/docs/quickstart/docker.md +++ b/docs/quickstart/docker.md @@ -142,7 +142,8 @@ Zeppelin service runs on local server, it auto configure itself to use `DockerIn - ${ZEPPELIN_HOME}/interpreter/${interpreterGroupName} - ${ZEPPELIN_HOME}/conf/zeppelin-site.xml - ${ZEPPELIN_HOME}/conf/log4j.properties - - ${ZEPPELIN\_HOME}/conf/log4j\_yarn_cluster.properties + - ${ZEPPELIN_HOME}/conf/log4j2.properties + - ${ZEPPELIN_HOME}/conf/log4j_yarn_cluster.properties - HADOOP\_CONF_DIR - SPARK\_CONF_DIR - /etc/krb5.conf diff --git a/docs/setup/deployment/docker.md b/docs/setup/deployment/docker.md index 9598dbf0d65..7e112db6c47 100644 --- a/docs/setup/deployment/docker.md +++ b/docs/setup/deployment/docker.md @@ -40,6 +40,12 @@ docker run -p 8080:8080 -e ZEPPELIN_IN_DOCKER=true --rm --name zeppelin apache/z Notice, please specify environment variable `ZEPPELIN_IN_DOCKER` when starting zeppelin in docker, otherwise you can not see the interpreter log. +Note: `ZEPPELIN_IN_DOCKER` applies to the all-in-one image built from +`scripts/docker/zeppelin/bin` (the `Dockerfile` referenced under "Building dockerfile +locally" below). The split `zeppelin-server`/`zeppelin-interpreter` images described in +"Build docker image for Zeppelin server & interpreters" already log to stdout by +default and don't need or support this flag. + * Zeppelin will run at `http://localhost:8080`. If you want to specify `logs` and `notebook` dir, diff --git a/scripts/docker/zeppelin/bin/Dockerfile b/scripts/docker/zeppelin/bin/Dockerfile index e4e91e30aa8..a7ffae2b94f 100644 --- a/scripts/docker/zeppelin/bin/Dockerfile +++ b/scripts/docker/zeppelin/bin/Dockerfile @@ -78,6 +78,11 @@ RUN echo "$LOG_TAG Download Zeppelin binary" && \ chmod 775 ${ZEPPELIN_HOME} && \ chmod -R 775 /opt/conda +# These 4 files are all required by bin/common.sh, not obsolete duplicates: +# log4j.properties / log4j_docker.properties configure reload4j, which backs the +# server and most interpreters; log4j2.properties / log4j2_docker.properties +# configure the real Log4j2 core that Flink bundles transitively. The "_docker" +# variants are only picked up when the ZEPPELIN_IN_DOCKER env var is set. COPY log4j.properties ${ZEPPELIN_HOME}/conf/ COPY log4j_docker.properties ${ZEPPELIN_HOME}/conf/ COPY log4j2.properties ${ZEPPELIN_HOME}/conf/ diff --git a/zeppelin-plugins/launcher/docker/src/main/java/org/apache/zeppelin/interpreter/launcher/DockerInterpreterProcess.java b/zeppelin-plugins/launcher/docker/src/main/java/org/apache/zeppelin/interpreter/launcher/DockerInterpreterProcess.java index 9c86a676083..521911d89c3 100644 --- a/zeppelin-plugins/launcher/docker/src/main/java/org/apache/zeppelin/interpreter/launcher/DockerInterpreterProcess.java +++ b/zeppelin-plugins/launcher/docker/src/main/java/org/apache/zeppelin/interpreter/launcher/DockerInterpreterProcess.java @@ -547,6 +547,7 @@ private void copyRunFileToContainer(String containerId) copyFiles.put( zeplConfPath + "/zeppelin-site.xml", containerZeplConfPath + "/zeppelin-site.xml"); copyFiles.put(zeplConfPath + "/log4j.properties", containerZeplConfPath + "/log4j.properties"); + copyFiles.put(zeplConfPath + "/log4j2.properties", containerZeplConfPath + "/log4j2.properties"); copyFiles.put(zeplConfPath + "/log4j_yarn_cluster.properties", containerZeplConfPath + "/log4j_yarn_cluster.properties");