logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: IBM Websphere Portal - log4j log file is empty!
Date Mon, 29 Aug 2005 21:56:20 GMT
Quoting Kalpeshkumar Soni <shyguy06@gmail.com>:

> Hi
>  I am facing a strange problem
>  1) My log4j jar is in java/lib directory and is loaded by bootstrap loader
> 2) My log4j.xml is loaded properly
>  The log4j.log file is created, but the file remains empty
> I do not get any errors/exceptions in SystemOut.log / SystemErr.log
>  except
> I see this one in SystemErr.log
> log4j:ERROR Servlet context [default] could not be found.
>  (Looks like log4j sandbox stuff, but i cannot file any class in my code
> that has this, it means portal server is using it internally)

You must have a Log4j config file that is using the ServletContextLogAppender
from the log4j-sandbox.  This works under Tomcat, but hasn't been tested much
under other appservers.  I've seen similar messages from Weblogic, but haven't
had time to investigate.  In any case, just remove this appender from your
config file.  You'll probably also want to remove the listener reference for
ServletContextLogAppenderListener from web.xml as well.


>  I am trying to use FileSystem logging
>   <appender name="dbglog" class="com.ibm.e2e.log.CompositeRollingAppender">
> <param name="File" value="../PortalServer/log/log4j.log" />
> <layout class="com.ibm.e2e.log.GWAPatternLayout">
> <param name="ConversionPattern" value="[WBI WorkFlow Application] [%C{1}.%M]
> [%d{MM/dd HH:mm:ss}] [%p] [%j] %m%n" />
> </layout>
> </appender>
>  public class CompositeRollingAppender extends org.apache.log4j.FileAppender{
> ................
>   Now the interesting part is
> there are two server instances (and hence two jvms) that use the same set of
> classes but different log4j.xml
>  server1 and WebSphere_Portal
>  lo4j logging is fine in first jvm (server1)
>  but in the portal server instance, the log file remains empty
>  Please help me figure out what is wrong !
>  Kalpeshkumar Soni
>

I suspect that someone is performing manual configuration of Log4j after default
configuration has already happened (webapp startup maybe?  Look for
org.apache.log4j.servlet.InitContextListener in web.xml and comment it out). 
Furthermore, classloading behavior of the webapp is most likely parent-first,
so it is using the log4j.jar in the bootclasspath rather than its own in
WEB-INF/lib.  So, your config is getting blown away.  You might want to set up
something like LogWeb so you can view the loggers and appenders on the server
in real time.  You can also modify configuration with it as well.  Works well!


Jake


---------------------------------------------------------------------
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