How do one read the Zookeeper transaction log?

Sriram Subramanian picture Sriram Subramanian · Jul 27, 2013 · Viewed 9.9k times · Source

Are there any existing tools that help to read the Zookeeper transaction log? By default, it is in binary format and I would like to read it in human readable form.

Answer

Oliver picture Oliver · Nov 25, 2015

I don't know if u have solved this question.

Answer:

cd the zookeeper dir.

If u want to read snapshots, use:

java -cp zookeeper-3.4.6.jar:lib/log4j-1.2.16.jar:lib/slf4j-log4j12-1.6.1.jar:lib/slf4j-api-1.6.1.jar org.apache.zookeeper.server.SnapshotFormatter version-2/snapshot.xxx

If u want to read logs, use:

java -cp zookeeper-3.4.6.jar:lib/log4j-1.2.16.jar:lib/slf4j-log4j12-1.6.1.jar:lib/slf4j-api-1.6.1.jar org.apache.zookeeper.server.LogFormatter version-2/log.xxx