ITPub博客

首页 > 大数据 > 数据分析 > ZooKeeper的系统打印Log的处理方法

ZooKeeper的系统打印Log的处理方法

原创 数据分析 作者:yanke_shanghai 时间:2016-05-31 19:41:31 0 删除 编辑
各位同学在执行Zookeeper程序的时候是不是会遇到一个问题,屏幕上打印出大量的Zookeeper日志,自己程序的日志被淹没在其中,很难调试程序。


对zookeeper的配置进行如下更改,可解决以上问题
首先修改: 
conf/log4j.properties: 
# Define some default values that can be overridden by system properties zookeeper.root.logger=INFO, CONSOLE
改成 
# Define some default values that can be overridden by system properties zookeeper.root.logger=INFO,ROLLINGFILE
还要修改bin/zkEvn.sh文件, 
if [ "x${ZOO_LOG4J_PROP}" = "x" ]
then
    ZOO_LOG4J_PROP="INFO,CONSOLE" fi
改成 
if [ "x${ZOO_LOG4J_PROP}" = "x" ]
then
    ZOO_LOG4J_PROP="INFO,ROLLINGFILE" fi
再次执行,将只剩下自己的打印log

zookeeper自带的log在这里:

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30316686/viewspace-2109955/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2015-06-30

  • 博文量
    65
  • 访问量
    353703