Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

zookpers log4j + Advanced zookeeper-log4j + how to get trace logs

Solved Go to solution
Highlighted

zookpers log4j + Advanced zookeeper-log4j + how to get trace logs

hi all


under /var/log/zookeeper , we have the zookeeper logs , as the following


-rw-r--r-- 1 zookeeper hadoop 104857712 Jul  5 15:54 zookeeper-zookeeper-server-master.sys87.com.log.1
-rw-r--r-- 1 zookeeper hadoop       177 Jul 16 11:57 zookeeper-zookeeper-server-master.sys87.com.out
-rw-r--r-- 1 zookeeper hadoop  66358998 Jul 16 23:15 zookeeper-zookeeper-server-master.sys87.com.log


the problem is that we get only the INFO severity from the logs!

and when we set the TRCE severity , and restart the zookeeper service , then its not change the zookeeper log content to trace mode,


can we get example of log4j for zookeeper ?

we suspect that our log4j isn't configured properly




Michael-Bronson
1 ACCEPTED SOLUTION

Accepted Solutions

Re: zookpers log4j + Advanced zookeeper-log4j + how to get trace logs

Super Mentor

@Michael Bronson
Inside the

Ambari UI --> Zookeerper --> Configs --> Advanced --> "Advanced zookeeper-log4j" you will find the zookeeper-log4j template.


Inside the template try this:

Change-1). Change the rootLogger line and enable 'TRACEFILE' appender

Comment the line:

#log4j.rootLogger=INFO, CONSOLE, ROLLINGFILE

And then uncomment the following line:

log4j.rootLogger=TRACE, CONSOLE, ROLLINGFILE, TRACEFILE


Change-2). Now inside the same template alter the line:

FROM

log4j.appender.TRACEFILE.File=zookeeper_trace.log

TO

log4j.appender.TRACEFILE.File={{zk_log_dir}}/zookeeper_trace.log


Now restart Zookeeper.

Then check the log "zookeeper_trace.log"

# tail -f /var/log/zookeeper/zookeeper_trace.log

.


2 REPLIES 2

Re: zookpers log4j + Advanced zookeeper-log4j + how to get trace logs

Super Mentor

@Michael Bronson
Inside the

Ambari UI --> Zookeerper --> Configs --> Advanced --> "Advanced zookeeper-log4j" you will find the zookeeper-log4j template.


Inside the template try this:

Change-1). Change the rootLogger line and enable 'TRACEFILE' appender

Comment the line:

#log4j.rootLogger=INFO, CONSOLE, ROLLINGFILE

And then uncomment the following line:

log4j.rootLogger=TRACE, CONSOLE, ROLLINGFILE, TRACEFILE


Change-2). Now inside the same template alter the line:

FROM

log4j.appender.TRACEFILE.File=zookeeper_trace.log

TO

log4j.appender.TRACEFILE.File={{zk_log_dir}}/zookeeper_trace.log


Now restart Zookeeper.

Then check the log "zookeeper_trace.log"

# tail -f /var/log/zookeeper/zookeeper_trace.log

.


Re: zookpers log4j + Advanced zookeeper-log4j + how to get trace logs

Super Mentor

@Michael Bronson

DEBUG/TRACE logging consumes much disk space. Hence it is better to disable them once you have collected enough race/debug logs for your troubleshooting purpose..