logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julien ALLANOS <julien.alla...@aql.fr>
Subject logging configurations confusion
Date Thu, 09 Dec 2004 13:23:58 GMT
Hi,

I'm trying to get log4j working with my webapps. I have 2 webapp running on the
same Tomcat 5.5 server, each one with its own log4j.rootLogger configured to
log to stdout.

So I expect to get logs from webapp1 and webapp2 in catalina.out. Each root
logger has its own pattern and log level, so I can distinguish between the two
in catalina.out. However, it seems they share the same logging configuration,
so I get only one pattern for the two webapps. Is this the normal behaviour?

Let's get into details:

webapp1
=3D=3D=3D=3D=3D=3D=3D
/webapp1/WEB-INF/web.xml
------------------------
[...]
  <servlet>
    <servlet-name>log4j-init</servlet-name>
    <servlet-class>wave.util.Log4jInit</servlet-class>

    <init-param>
      <param-name>log4j-init-file</param-name>
      <param-value>WEB-INF/Log.cfg</param-value>
    </init-param>

    <load-on-startup>1</load-on-startup>
  </servlet>
[...]


/webapp1/WEB-INF/Log.cfg
------------------------
log4j.rootLogger=3Derror, stdout

log4j.appender.stdout=3Dorg.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=3Dorg.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=3D[%p] %d{DATE}
(webapp1:%c.%M():%L) "%m"%n


webapp1 classes and JSP:
------------------------
[...]
private static Logger logger =3D Logger.getLogger("MyClass");
[...]
logger.debug("test");
[...]


The same for webapp2, except for its Log.cfg which contains the
  [%p] %d{DATE} (webapp2:%c.%M():%L) "%m"%n
pattern.

I see only "webapp2" in catalina.out, even for webapp1 classes.
Any help would be appreciated.

-- 
Julien ALLANOS
Silicomp-AQL

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


Mime
View raw message