janhoy opened a new pull request, #2076: URL: https://github.com/apache/zookeeper/pull/2076
https://issues.apache.org/jira/browse/ZOOKEEPER-4757 Straight-forward addition of JSON format logging through simple ENV var configuration. The output will be one JSON object per line, and the JSON format is standard ECS. This PR adds two dependencies. The logback-ecs library (10kb) and Janino (900kb) for conditional if-then-else support in logback.xml. Usage: ```bash $ ZOO_LOG_FORMAT=json bin/zkServer.sh start-foreground ZooKeeper JMX enabled by default Using config: /Users/janhoy/git/zookeeper/zookeeper-assembly/target/apache-zookeeper-3.10.0-SNAPSHOT-bin/bin/../conf/zoo.cfg {"@timestamp":"2023-10-10T18:14:26.041Z","log.level": "INFO","message":"Reading configuration from: /Users/janhoy/git/zookeeper/zookeeper-assembly/target/apache-zookeeper-3.10.0-SNAPSHOT-bin/bin/../conf/zoo.cfg","ecs.version": "1.2.0","service.name":"zookeeper","service.version":"3.10.0-SNAPSHOT","service.node.name":"MacBook-Pro-7.local","event.dataset":"zookeeper","process.thread.name":"main","log.logger":"org.apache.zookeeper.server.quorum.QuorumPeerConfig"} {"@timestamp":"2023-10-10T18:14:26.047Z","log.level": "INFO","message":"clientPortAddress is 0.0.0.0:2181","ecs.version": "1.2.0","service.name":"zookeeper","service.version":"3.10.0-SNAPSHOT","service.node.name":"MacBook-Pro-7.local","event.dataset":"zookeeper","process.thread.name":"main","log.logger":"org.apache.zookeeper.server.quorum.QuorumPeerConfig"} ... ``` By using conditional config feature, the user will not need to edit xml file but can simply supply an env var, which fits well with cloud-native use. -- 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: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org