Icewind52 commented on PR #24213:
URL: https://github.com/apache/kafka/pull/24213#issuecomment-6848325593

   ## Local Docker verification (JVM image)
   Built the image from this branch and compared it against the released 
`apache/kafka:latest`, both started with:
   
   ```
   docker run -d -e KAFKA_LOG4J_ROOT_LOGLEVEL=DEBUG -e 
KAFKA_TOOLS_LOG4J_LOGLEVEL=DEBUG <image>
   ```
   
   Image built with:
   
   ```
   ./gradlew clean releaseTarGz -x test
   cd docker && python3 docker_build_test.py kafka/test --image-tag=local-build 
--image-type=jvm \
     
--kafka-archive=<path>/core/build/distributions/kafka_2.13-<version>-SNAPSHOT.tgz
   ```
   
   **Generated `Root` in `/opt/kafka/config/log4j2.yaml`**
   
   Before (`apache/kafka:latest`):
   ```yaml
   Root:
     level: "DEBUG"
   ```
   
   After (this PR):
   ```yaml
   Root:
     level: "DEBUG"
     AppenderRef:
     - ref: "STDOUT"
     - ref: "KafkaAppender"
   ```
   
   **Generated `Root` in `/opt/kafka/config/tools-log4j2.yaml`**
   
   Before:
   ```yaml
   Root:
     level: "DEBUG"
   ```
   
   After:
   ```yaml
   Root:
     level: "DEBUG"
     AppenderRef:
     - ref: "STDERR"
   ```
   
   **Broker and tools output, ~20s after start**
   
   | | Before | After |
   |---|---|---|
   | `docker logs` (stdout) lines | 7 | 2449 |
   | `/opt/kafka/logs/server.log` size | 0 bytes | 127,637 bytes |
   | `kafka-topics.sh --list` DEBUG lines on stderr | – | 33 | 
                                   
   Before the fix, everything that relies on the root appenders was silent: 
stdout had only the launch script's output, and `server.log` was own appenders 
(`controller.log`,`log-cleaner.log`) were not affected either way.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to