This patch changes the code to support log4j logging. Please review and let me know if there are any comments/questions. I highly suggest you try running with this patch and make sure you like the behavior (we can easily change the formatting of the log messages themselves - you can play with this by changing the log4j properties file).
I'm doing this cutover in stages. This first stage is to get
log4j integrated and move most of the code over to log4j. Partly to break
things up into more manageable (mergeable) chunks but also partly so that
ppl can try things out and we can more easily change if there are issues.
Also note: the originally code almost exclusivley used "logError" and
"logWarn", there didn't seem to be a notion of "info" level messages. In
this first pass I mapped these calls to LOG.error and LOG.warn respectively.
We MUST go through the code and update the calls to accurately reflect
the log level intended. I plan to do a pass on this during the next
stage of migration.
Also note: the original code had the notion of tracing as well as error/warn
logging. I've kept the tracing as-is for the time being. I will migrate
this code in a future stage as well.
To apply this patch:
1) unarchive the attached archive file w/in the zookeeper top level directory
2) apply the patch contained in the tar file
3) remove log4j-1.2.9.jar from java/lib
1) there are 2 new shell scripts in bin directory, one for running
the server and one for running the client shell.
App startup now has more options -- having these scripts will simplify
the onboarding process (new users). We will need to update the docs on
the twiki to reflect this change.
2) zookeeper-dev.jar is now generated into java/lib directory
3) the server default log4j config has 2 appenders - one to the console and
one to a file. Notice that the console does not include the date (but
we could change the config file if this is considered important to have
We need to document log4j configuration in zk on our twiki.
The client log4j config only outputs to the console.
Log in to post a comment.