You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Kevin A. Burton" <bu...@newsmonster.org> on 2004/12/03 22:26:46 UTC

Tomcat DEBUG log4j and 5.5.4?

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html

Does this actually work?  I followed the steps for log4j and it won't 
work at all. I still get the standard logging.  Are there any properties 
settings I can use to get more info on the bootstrap process?

Kevin

-- 

Use Rojo (RSS/Atom aggregator).  Visit http://rojo.com. Ask me for an 
invite!  Also see irc.freenode.net #rojo if you want to chat.

Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html

If you're interested in RSS, Weblogs, Social Networking, etc... then you 
should work for Rojo!  If you recommend someone and we hire them you'll 
get a free iPod!
    
Kevin A. Burton, Location - San Francisco, CA
       AIM/YIM - sfburtonator,  Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412


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


Re: Tomcat DEBUG log4j and 5.5.4?

Posted by Jacob Kjome <ho...@visi.com>.
Getting log4j logging running in Tomcat-5.5.x is pretty simple.  Here's what you
need...

1.  Put log4j.jar in common/lib
2.  Put commons-logging.jar (not commons-logging-api.jar!) in common/lib
3.  Put log4j.xml or log4j.properties in common/classes

You'll want to look at the new naming scheme for Host and Context loggers in the
5.5 docs.  Note that if you are using log4j-1.2.x, you can't use log4j.xml
because of the way the Host and Context loggers are named.  They use characters
that conflict with what the XML spec defines as allowed characters for an
attribute of type "ID".  What I mean is the <logger> "name" attribute, which is
of type "ID" when using the DOMConfigurator.  Log4j-1.3 deprecates the
DOMConfigurator in favor of the JoranConfigurator which doesn't validate
against a DTD, so there is no conflict there.  For now, just use the properties
format. Here's a sample log4j.properties...

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.A2=org.apache.log4j.FileAppender
#log4j.appender.A2.File=${catalina.home}/logs/stdout.log
#log4j.appender.A2.Append=false
#log4j.appender.A2.layout=org.apache.log4j.PatternLayout
#log4j.appender.A2.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.SOMEAPP=org.apache.log4j.DailyRollingFileAppender
log4j.appender.SOMEAPP.File=${catalina.home}/logs/localhost_someapp.log
log4j.appender.SOMEAPP.DatePattern='.'yyyy-MM-dd
log4j.appender.SOMEAPP.layout=org.apache.log4j.PatternLayout
log4j.appender.SOMEAPP.layout.ConversionPattern=%c{1} %-6r - %m%n

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


log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/someapp]=DEBUG,
SOMEAPP
log4j.additivity.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/someapp]=false

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

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

log4j.rootLogger=INFO, A1



Jake


Quoting "Kevin A. Burton" <bu...@newsmonster.org>:

> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html
>
> Does this actually work?  I followed the steps for log4j and it won't
> work at all. I still get the standard logging.  Are there any properties
> settings I can use to get more info on the bootstrap process?
>
> Kevin
>
> --
>
> Use Rojo (RSS/Atom aggregator).  Visit http://rojo.com. Ask me for an
> invite!  Also see irc.freenode.net #rojo if you want to chat.
>
> Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html
>
> If you're interested in RSS, Weblogs, Social Networking, etc... then you
> should work for Rojo!  If you recommend someone and we hire them you'll
> get a free iPod!
>
> Kevin A. Burton, Location - San Francisco, CA
>        AIM/YIM - sfburtonator,  Web - http://peerfear.org/
> GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412
>
>
> ---------------------------------------------------------------------
> 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