java - log4j warning after `homebrew install zookeeper` -
i'm running mac os x 10. did brew install zookeeper
.
then created /usr/local/etc/zookeeper/zoo.cfg
based on /usr/local/etc/zookeeper/zoo_sample.cfg
.
then zkserver start
works fine.
but, when trying connect zookeeper clojure, uses zookeeper java client, error:
log4j:warn no appenders found logger (org.apache.zookeeper.zookeeper). log4j:warn please initialize log4j system properly. log4j:warn see http://logging.apache.org/log4j/1.2/faq.html#noconfig more info.
my log4j.properties
file:
log4j.rootcategory=warn, zklog log4j.appender.zklog = org.apache.log4j.fileappender log4j.appender.zklog.file = /usr/local/var/log/zookeeper/zookeeper.log log4j.appender.zklog.append = true log4j.appender.zklog.layout = org.apache.log4j.patternlayout log4j.appender.zklog.layout.conversionpattern = %d{yyyy-mm-dd hh:mm:ss} %c{1} [%p] %m%n
so, questions are:
- what reasonable log4j configuration situation?
- what homebrew do, out of box, prevent warning happening?
to clear, there 2 log4j.properties
files involved. one created homebrew , gets written /usr/local/etc/zookeeper/log4j.properties
. file not cause of error message above.
the other log4j.properties
file particular (my) application. so, answer part 1 of question, create log4j.properties
file on classpath of clojure app, such in src
directory.
log4j.rootlogger=warn, a1 log4j.logger.user=debug log4j.appender.a1=org.apache.log4j.consoleappender log4j.appender.a1.layout=org.apache.log4j.patternlayout log4j.appender.a1.layout.conversionpattern=%d %-5p %c: %m%n log4j.logger.org.apache.zookeeper=warn
i built starting https://github.com/clojure/tools.logging , adding last line.
to answer part 2, homebrew not , should not have how clojure application sets logging.
Comments
Post a Comment