Description
AsynchAppender parameter:
blocking=false ==> LogEvents are never distributed to other appenders
blocking=true ==> the appender don't blocks if the queue is full
proposal for solution:
AsynchAppender.java
public void append(final LogEvent event) {
if (!isStarted())
if (event instanceof Log4jLogEvent) {
// if (blocking && queue.remainingCapacity() > 0) {
// try
catch (final IllegalStateException ex)
{ // error("Appender " + getName() + " is unable to write primary appenders. queue is full"); // }// }
// if (errorAppender != null) {
// if (!blocking) {// error("Appender " + getName() + " is unable to write primary appenders. queue is full");// }
// errorAppender.callAppender(event);
// }
boolean appendSuccessful = false;
if (blocking){
try
catch (InterruptedException e) {
LOGGER.warn("Interrupted while waiting for a free slots in the LogEvent-queue at the AsynchAppender {}", getName());
}
}else{
appendSuccessful = queue.offer(Log4jLogEvent.serialize((Log4jLogEvent) event));
if (!appendSuccessful)
}
if ((!appendSuccessful) && (errorAppender != null))
}
}