[opencms-dev] log4j WARN in tomcat

ruben malchow r_malchow at web.de
Wed Sep 20 12:21:25 CEST 2006


> # Per default we use WARN debug level and just one appender
> log4j.rootLogger=\
> ERROR,\
> OC
> it seems that tomcat or the opencms set the logger to a WARN level ,
> and you set it to a INFO level , right?

yes, you're pretty much right. except that, despite the comment (which
says "we use WARN debug level"), the actual value is set to ERROR. also,
this is only the value for the root logger (some kind of catch-all for
non-configured loggers. you may configure other loggers in a similar
way. if the log4j.properties you have there comes from the opencms
distribution, you probably have some more lines such as this one:

log4j.logger.org.opencms.init=INFO

or:

log4j.logger.org.opencms.workplace.tools=WARN

by setting some parts of it to other debug levels, you can control the
verbosity of specific parts of your application.

however, these are opencms specific loggers which don't really belong in
this global config:

$tomcat/common/classes/log4j.properties

but rather in a webapp-specific config file such as:

$tomcat/webapps/opencms/WEB-INF/classes/log4j.properties


the global log4j config file should be used for tomcat specific loggers
such as:

log4j.logger.org.apache.catalina.core=DEBUG,tomcat_core
log4j.appender.tomcat_core=org.apache.log4j.ConsoleAppender

you may be familiar with lines such as:

DEBUG main org.apache.catalina.core.ContainerBase.[Catalina] -
EngineConfig: Processing START

in your tomcat logs. the part after "DEBUG main" is the part that
specifies the logger.



ruben





















More information about the opencms-dev mailing list