I am using log4j 1.2.4 and running into a problem where the append
method in the AsyncAppender is in a wait state because the BoundedFIFO
is full (see code snippet of AsyncAppender class below). Because of the
synchronization, other log messages can not be added to the queue and
they are in a wait state as well ... basically bringing the system
(weblogic 6.1 SP4 on JDK 1.3.1) to a halt.
Can anyone tell me why this is happening? It does not happen very
frequent but when more load (i.e. more logs) is put on the system, it
appears more often. Our config XML contains 3 appenders with one
writing to a ConsoleAppender, one writing to the
DailyRollingFileAppender, and one writing to the AsyncAppender. Is it
as simple as increasing the BoundedFIFO size or is that just masking the
problem.
the method that is causing the block in AsyncAppender:
void append(LoggingEvent event) {
--- omitted ---
synchronized(bf) {
while(bf.isFull()) {
try {
//LogLog.debug("Waiting for free space in buffer, "+bf.length());
bf.wait();
} catch(InterruptedException e) {
if(!interruptedWarningMessage) {
interruptedWarningMessage = true;
LogLog.warn("AsyncAppender interrupted.", e);
} else {
LogLog.warn("AsyncAppender interrupted again.");
}
}
--- omitted ---
Thank you for any comments/suggestions you may have
Matthew Bates
AfterBOT, Inc.
4351 Shackleford Road
Norcross, GA 30093
http://www.AfterBOT.com <http://www.afterbot.com/>