At 02:36 PM 8/25/2003 -0500, Jacob Kjome wrote:
I'm seeing an issue when I have more than one webapp's log4j.xml using the ServletContextLogAppender for a logger. I'm attaching the relevant part of the log file. I included Log4j's own debugging.

Anyone know what this is happening? I think I know where it is coming from. DomConfigurator#parseAppender() seems to return null, but I'm not sure why?

That is correct. The reasons is that on line 164, Loader.loadclass(classname).newInstance() is returning null. On the next line, the class case fails because null objects cannot be cast.


164:  Object instance   = Loader.loadClass(className).newInstance();
165:  Appender appender = (Appender)instance;

I think the problem is due to the fact that ServletContextLogAppender does not have a public constructor.

Just add the line

public ServletContextLogAppender() {}

and it should work. I think...

Let us know if it makes a difference.

Note that log4j.jar and log4j-sandbox.jar are in CATALINA_HOME/common/lib and shared/lib respectively (the jars can see each other just fine even in the the separate lib directories). I'm using the ContextJNDISelector to manage logger repositories. The other appenders work just fine. Only if I add an <appender-ref> referencing the named ServletContextLogAppender in the second app being configured (and presumably any additional apps) do I get the stacktrace.

Jake

-- Ceki For log4j documentation consider "The complete log4j manual" ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to