From 965cd8a8f639041c7e4115f1c8309968b3c3136f Mon Sep 17 00:00:00 2001 From: Ceki Gulcu Date: Sun, 15 Dec 2024 17:51:15 +0100 Subject: [PATCH] more javadocs Signed-off-by: Ceki Gulcu --- .../org/apache/log4j/NewAsyncAppender.java | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/log4j/NewAsyncAppender.java b/src/main/java/org/apache/log4j/NewAsyncAppender.java index 974ba12e..71e89f7e 100644 --- a/src/main/java/org/apache/log4j/NewAsyncAppender.java +++ b/src/main/java/org/apache/log4j/NewAsyncAppender.java @@ -31,9 +31,43 @@ import java.util.concurrent.atomic.AtomicInteger; /** - *

An asynchronous appender closely reproducing the behaviour of logback's AsyncAppender. + *

An asynchronous appender closely reproducing the behaviour of logback's AsyncAppender. *

- *

See l

+ * + *

See Logback's AsyncAppender documentation for configuration options. + *

+ * + * Here is a sample configuration file for NewAsyncAppender. + * + *
+ * <log4j:configuration debug="true"
+ *                      xmlns:log4j='http://jakarta.apache.org/log4j/'>
+ *
+ *    <appender name="FILE" class="org.apache.log4j.FileAppender">
+ *      <param name="File"   value="/tmp/foobar.log" />
+ *      <param name="Append" value="false" />
+ *
+ *      <layout class="org.apache.log4j.PatternLayout">
+ *        <param name="ConversionPattern" value="%-5p %c{2} - %m%n"/>
+ *      </layout>
+ *   </appender>
+ *
+ *     <appender name="ASYNC" class="org.apache.log4j.NewAsyncAppender">
+ *         <param name="QueueSize" value="512"/>
+ *         <appender-ref ref="FILE"/>
+ *     </appender>
+ *
+ *     <root>
+ *         <level value="info"/>
+ *         <appender-ref ref="ASYNC"/>
+ *     </root>
+ *
+ * </log4j:configuration>
+ *
+ *
+ * 
+ * + *

Note: NewAyncAppedner requires DOMConfigurator, i.e. XML configuration format.

* @since 1.2.26 */ public class NewAsyncAppender extends AppenderSkeleton implements AppenderAttachable {