logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Brodhead <...@black-ice.org>
Subject Re: no logging when running multiple threads
Date Tue, 22 Jan 2002 02:39:38 GMT

> log4j:ERROR Attempted to append to closed appender named
> [APPENDER_CONSOLE].
> log4j:WARN Not allowed to write to a closed appender.
> log4j:ERROR Attempted to append to closed appender named [APPENDER_CMA].
> log4j:WARN Not allowed to write to a closed appender.

Aaron,

This seems in sync with what I would expect from a thread safety
problem.

Can you confirm that the Log4j initialization happens properly?  Does
anything get written to the logs before the problem occurs?  If so,
then we can assume that the appender is somehow getting clobbered
later on.

Static initializers are very convenient, but sometimes the
interactions can get hairy.  Just because you see those Categories
getting initialized in your source code does not mean the
initialization is actuall happening correctly.

Is everything running in a single JVM?  Or might you have multiple
JVMs instantiating appenders that want to write to the same file(s)?
I haven't looked through that portion of the Log4j source yet, but it
is not unreasonable for an Appender to try for exclusive access to a
file, meaning that other Appenders would fail at startup.

Go nuts with System.out.println and see what you find.

--mkb



--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message