Zookeeper does not have .log logs, only .out logs

Zookeeper does not have .log logs, only .out logs

Background: It was found that zookeeper has no .log log, only .out log.
Insert image description here
It was found that there is only .out file in the logs directory, and every time ZooKeeper is restarted, the .out log will be overwritten. In
order to have a complete log log, the following parameters are required:
1. zk_home is configured in the my_env.sh file

#ZOOKEEPER_HOME
export ZOOKEEPER_HOME=/opt/module/apache-zookeeper-3.5.9-bin
export PATH=$PATH:$ZOOKEEPER_HOME/bin

Insert image description here
2. Modify zkEnv.sh file
settings:

[sarah@hadoop104 conf]$ vim  /opt/module/apache-zookeeper-3.5.9-bin/zkEnv.sh
ZOO_LOG_DIR="${ZOOKEEPER_HOME}/logs"
ZOO_LOG4J_PROP="INFO,CONSOLE,ROLLINGFILE"

Insert image description here
3. Modify the log4j file

[sarah@hadoop104 conf]$ vim  /opt/module/apache-zookeeper-3.5.9-bin/conf/log4j.properties
zookeeper.root.logger=INFO, ROLLINGFILE

Insert image description here
4. Distribute the above three files, source the environment variables, and restart zk. You will find that there are .log files in the logs directory.
Insert image description here

Guess you like

Origin blog.csdn.net/m0_37759590/article/details/132804923