zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From René Weinert <rene_wein...@hotmail.com>
Subject AW: Log4j-Properties
Date Sat, 10 Dec 2011 01:45:37 GMT
Ok, that was a little bit nasty... including it to the classpath didn't
help, but adding the following to the java command did:
-Dlog4j.configuration="file:log4j.properties"

Thanks!
René

-----Ursprüngliche Nachricht-----
Von: Patrick Hunt [mailto:phunt@apache.org] 
Gesendet: Thursday, December 08, 2011 6:00 PM
An: user@zookeeper.apache.org
Betreff: Re: Log4j-Properties

No idea. However it's possible that ycsb is deploying your code but not your
log4j.properties file. Try adding it to the jar?

Patrick

On Thu, Dec 8, 2011 at 12:32 PM, René Weinert <rene_weinert@hotmail.com>
wrote:
> Hello,
>
> I’m using Zookeeper together with YCSB++ (a cloud benchmarking tool). 
> When executing this I get the warning:
>
>
>
> “log4j:WARN No appenders could be found for logger 
> (org.apache.zookeeper.ZooKeeper).
>
> log4j:WARN Please initialize the log4j system properly.
>
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig 
> for more info.”
>
>
>
> I included the standard log4j.properties file of Zookeeper in the 
> classpath of my application but still keep getting this error. Do you 
> have any idea on how to solve this?
>
> Indeed there are no appenders defined for 
> org.apache.zookeeper.ZooKeeper (see below) – could this be the reason? 
> And how would these have to look like?
>
>
>
> Thanks
>
> René
>
>
>
>
>
> PS: Here the content of the log4j.properties (didn’t change anything 
> from the default):
>
>
>
> #
>
> # ZooKeeper Logging Configuration
>
> #
>
>
>
> # Format is "<default threshold> (, <appender>)+
>
>
>
> # DEFAULT: console appender only
>
> log4j.rootLogger=INFO, CONSOLE
>
>
>
> # Example with rolling log file
>
> #log4j.rootLogger=DEBUG, CONSOLE, ROLLINGFILE
>
>
>
> # Example with rolling log file and tracing
>
> #log4j.rootLogger=TRACE, CONSOLE, ROLLINGFILE, TRACEFILE
>
>
>
> #
>
> # Log INFO level and above messages to the console
>
> #
>
> log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
>
> log4j.appender.CONSOLE.Threshold=INFO
>
> log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p 
> [%t:%C{1}@%L] - %m%n
>
>
>
> #
>
> # Add ROLLINGFILE to rootLogger to get log file output
>
> #    Log DEBUG level and above messages to a log file
>
> log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
>
> log4j.appender.ROLLINGFILE.Threshold=DEBUG
>
> log4j.appender.ROLLINGFILE.File=zookeeper.log
>
>
>
> # Max log file size of 10MB
>
> log4j.appender.ROLLINGFILE.MaxFileSize=10MB
>
> # uncomment the next line to limit number of backup files
>
> #log4j.appender.ROLLINGFILE.MaxBackupIndex=10
>
>
>
> log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} - %-5p 
> [%t:%C{1}@%L] - %m%n
>
>
>
>
>
> #
>
> # Add TRACEFILE to rootLogger to get log file output
>
> #    Log DEBUG level and above messages to a log file
>
> log4j.appender.TRACEFILE=org.apache.log4j.FileAppender
>
> log4j.appender.TRACEFILE.Threshold=TRACE
>
> log4j.appender.TRACEFILE.File=zookeeper_trace.log
>
>
>
> log4j.appender.TRACEFILE.layout=org.apache.log4j.PatternLayout
>
> ### Notice we are including log4j's NDC here (%x)
>
> log4j.appender.TRACEFILE.layout.ConversionPattern=%d{ISO8601} - %-5p 
> [%t:%C{1}@%L][%x] - %m%n
>
>
>
>
>


Mime
View raw message