You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by René Weinert <re...@hotmail.com> on 2011/12/08 21:32:51 UTC
Log4j-Properties
Hello,
Im 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 (didnt 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
Re: Log4j-Properties
Posted by Patrick Hunt <ph...@apache.org>.
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 <re...@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
>
>
>
>
>
AW: Log4j-Properties
Posted by René Weinert <re...@hotmail.com>.
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 <re...@hotmail.com>
wrote:
> Hello,
>
> Im 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 (didnt 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
>
>
>
>
>