Overview
You may need to investigate a Zookeeper issue (crash, slowness, process hanging, etc...) and you will find that in some instances (eg. AWSE environment), Zookeeper is running as a service, with events logged in the journal and/or messages/syslog.
You can enable debug logging for the Zookeeper process and push it within its own log and location.
Applies To
All versions
Details
To do so, you will need to add the following 2 lines at the end of /opt/zookeeper/bin/zkEnv.sh
:
ZOO_LOG_DIR="/var/log/zookeeper"
ZOO_LOG4J_PROP="DEBUG,ROLLINGFILE"
You may need to create a new var/log/zookeeper
directory with RW permissions before restarting the zookeeper
service with command sudo systemctl restart zookeeper.service
Further Reading
Keep in mind log rotation, dealt with inside your /opt/zookeeper/conf/log4j.properties
file via:
log4j.appender.ROLLINGFILE.MaxFileSize=10MB
where you can choose to increase or reduce the size according to your needs.