Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

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

avatar

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

avatar
Master 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

.


View solution in original post

2 REPLIES 2

avatar
Master 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

.


avatar
Master 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..