You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2014/04/01 06:36:28 UTC
svn commit: r1583528 -
/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
Author: ggregory
Date: Tue Apr 1 04:36:28 2014
New Revision: 1583528
URL: http://svn.apache.org/r1583528
Log:
Better names.
Modified:
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java?rev=1583528&r1=1583527&r2=1583528&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java Tue Apr 1 04:36:28 2014
@@ -123,28 +123,28 @@ public final class AsyncAppender extends
/**
* Actual writing occurs here.
* <p/>
- * @param evt The LogEvent.
+ * @param logEvent The LogEvent.
*/
@Override
- public void append(final LogEvent evt) {
+ public void append(final LogEvent logEvent) {
if (!isStarted()) {
throw new IllegalStateException("AsyncAppender " + getName() + " is not active");
}
- if (!(evt instanceof Log4jLogEvent)) {
+ if (!(logEvent instanceof Log4jLogEvent)) {
return; // only know how to Serialize Log4jLogEvents
}
- Log4jLogEvent event = (Log4jLogEvent) evt;
+ Log4jLogEvent coreEvent = (Log4jLogEvent) logEvent;
boolean appendSuccessful = false;
if (blocking) {
if (isAppenderThread.get() == Boolean.TRUE && queue.remainingCapacity() == 0) {
// LOG4J2-485: avoid deadlock that would result from trying
// to add to a full queue from appender thread
- event.setEndOfBatch(false); // queue is definitely not empty!
- appendSuccessful = thread.callAppenders(event);
+ coreEvent.setEndOfBatch(false); // queue is definitely not empty!
+ appendSuccessful = thread.callAppenders(coreEvent);
} else {
try {
// wait for free slots in the queue
- queue.put(Log4jLogEvent.serialize(event, includeLocation));
+ queue.put(Log4jLogEvent.serialize(coreEvent, includeLocation));
appendSuccessful = true;
} catch (final InterruptedException e) {
LOGGER.warn("Interrupted while waiting for a free slot in the AsyncAppender LogEvent-queue {}",
@@ -152,13 +152,13 @@ public final class AsyncAppender extends
}
}
} else {
- appendSuccessful = queue.offer(Log4jLogEvent.serialize(event, includeLocation));
+ appendSuccessful = queue.offer(Log4jLogEvent.serialize(coreEvent, includeLocation));
if (!appendSuccessful) {
error("Appender " + getName() + " is unable to write primary appenders. queue is full");
}
}
if (!appendSuccessful && errorAppender != null) {
- errorAppender.callAppender(event);
+ errorAppender.callAppender(coreEvent);
}
}