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

KAFKA-18388: test-kraft-server-start.sh should use log4j2.yaml #18370

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

FrankYang0529
Copy link
Member

Run script and can see logs:

> cd raft
> bin/test-kraft-server-start.sh --config config/kraft.properties --replica-directory-id b8tRS7h4TJ2Vt43Dp85v2A
[2025-01-01 23:04:08,112] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
[2025-01-01 23:04:08,182] INFO Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation (org.apache.zookeeper.common.X509Util)
[2025-01-01 23:04:08,363] INFO Updated connection-accept-rate max connection creation rate to 2147483647 (kafka.network.ConnectionQuotas)
...

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@github-actions github-actions bot added kraft small Small PRs labels Jan 1, 2025
@FrankYang0529 FrankYang0529 force-pushed the KAFKA-18388 branch 3 times, most recently from 50477c2 to 69b1778 Compare January 4, 2025 15:08
@chia7712
Copy link
Member

chia7712 commented Jan 5, 2025

@FrankYang0529 could you please test log4j properties also? It should work with some deprecation warnings

@FrankYang0529
Copy link
Member Author

could you please test log4j properties also? It should work with some deprecation warnings

Yes, it works as well.

  1. Set up raft/config/kraft-log4j.properties.
log4j.rootLogger=INFO, stderr

log4j.appender.stderr=org.apache.log4j.ConsoleAppender
log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
log4j.appender.stderr.layout.ConversionPattern=[%d] %p %m (%c)%n
log4j.appender.stderr.Target=System.err

log4j.logger.org.apache.kafka.raft=INFO
log4j.logger.org.apache.kafka.snapshot=INFO
  1. Run test-kraft-server-start.sh.
> cd raft
> KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:config/kraft-log4j.properties" bin/test-kraft-server-start.sh --config config/kraft.properties --replica-directory-id b8tRS7h4TJ2Vt43Dp85v2A
-Dlog4j.configuration=file:config/kraft-log4j.properties
DEPRECATED: A Log4j 1.x configuration file has been detected, which is no longer recommended.
To use a Log4j 2.x configuration, please see https://logging.apache.org/log4j/2.x/migrate-from-log4j1.html#Log4j2ConfigurationFormat for details about Log4j configuration file migration.
You can also use the $KAFKA_HOME/config/tools-log4j2.yaml file as a starting point. Make sure to remove the Log4j 1.x configuration after completing the migration.
[2025-01-05 11:18:55,187] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
[2025-01-05 11:18:55,272] INFO Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation (org.apache.zookeeper.common.X509Util)
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants