logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yair Ogen <yairo...@gmail.com>
Subject Re: using a different log4j.properties file per classes directory
Date Mon, 13 Jul 2009 06:30:53 GMT
log4j under Tomcat is known to be "fishy" regarding class path.
Are you sure this suggestion works?

On Mon, Jul 13, 2009 at 10:27 AM, Jacob Kjome <hoju@visi.com> wrote:

> You have to deploy log4j.jar in both common/lib as well as WEB-INF/lib of
> each
> app.  Tomcat will use the one in common/lib and each webapp will use the
> one in
> its respective WEB-INF/lib (because of child-first, or parent-last,
> classloading
> behavior of webapps).
>
> Jake
>
> On 7/11/2009 6:01 PM, Lucas Vickers wrote:
> > Hello,
> > Excuse my simple question as I am new to tomcat/log4j.
> > I have looked at the mailing list and did some googling but no luck.
> >
> > What I would like to do is have my tomcat installation use one log file,
> and
> > then my own servlet use a different log file.
> >
> > ./common/classes/log4j.properties =
> >
> > log4j.rootLogger=INFO, R
> > log4j.appender.R=org.apache.log4j.RollingFileAppender
> > log4j.appender.R.File=${catalina.home}/logs/tomcat.log
> > log4j.appender.R.MaxFileSize=100MB
> > log4j.appender.R.MaxBackupIndex=50
> > log4j.appender.R.layout=org.apache.log4j.PatternLayout
> > log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
> >
> > ./webapps/servlets-examples/WEB-INF/classes/log4j.properties =
> >
> > log4j.rootLogger=DEBUG, R
> > log4j.appender.R=org.apache.log4j.RollingFileAppender
> > log4j.appender.R.File=${catalina.home}/logs/tabs.log
> > log4j.appender.R.MaxFileSize=10MB
> > log4j.appender.R.MaxBackupIndex=100
> > log4j.appender.R.layout=org.apache.log4j.PatternLayout
> > log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
> >
> > Ideal result is that my class in /servlets-examples will be in DEBUG
> level
> > and will output to the "tabs.log"
> >
> > It appears that my servlet-examples is outputting to tomcat.og and is in
> > INFO level.
> >
> > Could anyone please help me figure out what I am missing.
> > Many thanks,
> > Lucas
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message