You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Philippe Mathieu <ph...@lifl.fr> on 2005/01/29 18:58:32 UTC

commons-loggin instead of loggers

Hi,

Loggers seems to have disappeared since 5.5 release
It seems that we must use commons-loggin

Does someone have an example to replace my classical logger which was in 
my context
   <Logger className="org.apache.catalina.logger.FileLogger"
           prefix="myappli_log." suffix=".txt"   timestamp="true"/>



PS: What is exactly the diff between a Logger and a Valve ? It seems to 
cover the same things ?



Phil

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: commons-loggin instead of loggers

Posted by Jacob Kjome <ho...@visi.com>.
Put log4j-1.2.9.jar and commons-logging-1.0.4.jar (not 
commons-logging-api.jar!!!!!!)  in CATALINA_HOME/common/lib and 
log4j.properties in CATALINA_HOME/common/classes and make the properties 
file look something like...

log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p[%-8.8t]: %39.39c %-6r - %m%n

log4j.appender.LOCALHOST=org.apache.log4j.RollingFileAppender
log4j.appender.LOCALHOST.File=${catalina.home}/logs/localhost.log
log4j.appender.LOCALHOST.MaxFileSize=1000KB
log4j.appender.LOCALHOST.MaxBackupIndex=1
log4j.appender.LOCALHOST.layout=org.apache.log4j.PatternLayout
log4j.appender.LOCALHOST.layout.ConversionPattern=%-5p[%-8.8t]: %39.39c 
%-6r - %m%n

log4j.appender.MYAPP=org.apache.log4j.DailyRollingFileAppender
log4j.appender.MYAPP.File=${catalina.home}/logs/localhost_myapp.log
log4j.appender.MYAPP.DatePattern='.'yyyy-MM-dd
log4j.appender.MYAPP.layout=org.apache.log4j.PatternLayout
log4j.appender.MYAPP.layout.ConversionPattern=%c{1} %-6r - %m%n

log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=INFO, 
LOCALHOST
log4j.additivity.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=false

log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/myapp]=INFO, 
MYAPP
log4j.additivity.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/myapp]=false

log4j.rootLogger=INFO, A1


Don't try using a log4j.xml file.  The logger names above are illegal id 
attribute values and will cause an XML parsing error.  The <logger> "name" 
attribute is defined as of type "id" in the log4j.dtd.   This won't be an 
issue in Log4j-1.3 but still is, and will always be, in Log4j-1.2.x.

BTW, Valves are like Filters, but at the server level rather than at the 
application level.  The fact that a Valve might log something doesn't make 
it a logger itself.

Jake

At 06:58 PM 1/29/2005 +0100, you wrote:
 >Hi,
 >
 >Loggers seems to have disappeared since 5.5 release
 >It seems that we must use commons-loggin
 >
 >Does someone have an example to replace my classical logger which was in
 >my context
 >   <Logger className="org.apache.catalina.logger.FileLogger"
 >           prefix="myappli_log." suffix=".txt"   timestamp="true"/>
 >
 >
 >
 >PS: What is exactly the diff between a Logger and a Valve ? It seems to
 >cover the same things ?
 >
 >
 >
 >Phil
 >
 >---------------------------------------------------------------------
 >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
 >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
 >
 >  


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org