Repository: logging-log4j2
Updated Branches:
  refs/heads/master 05aef39ab -> 053765adf


LOG4J2-1179 benchmarks for performance page async logging + caller location 
information


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/bd4558b8
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/bd4558b8
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/bd4558b8

Branch: refs/heads/master
Commit: bd4558b80fc084fc9542429cea3e42e6424947f4
Parents: 05aef39
Author: rpopma <[email protected]>
Authored: Sat May 7 23:12:04 2016 +0900
Committer: rpopma <[email protected]>
Committed: Sat May 7 23:12:04 2016 +0900

----------------------------------------------------------------------
 .../AsyncAppenderLog4j1LocationBenchmark.java   | 71 +++++++++++++++++
 .../AsyncAppenderLog4j2LocationBenchmark.java   | 75 +++++++++++++++++
 .../AsyncAppenderLogbackLocationBenchmark.java  | 77 ++++++++++++++++++
 .../perf/jmh/AsyncLoggersLocationBenchmark.java | 84 ++++++++++++++++++++
 .../perf/jmh/MemoryHandlerJULBenchmark.java     |  1 +
 .../jmh/MemoryHandlerJULLocationBenchmark.java  | 74 +++++++++++++++++
 .../perf-WithoutAnyAppender-location.xml        | 12 +++
 ...perf-log4j12-async-location-noOpAppender.xml | 31 ++++++++
 ...perf-logback-async-location-noOpAppender.xml | 31 ++++++++
 .../perf5AsyncApndWithLoc-noOpAppender.xml      | 31 ++++++++
 10 files changed, 487 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bd4558b8/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j1LocationBenchmark.java
----------------------------------------------------------------------
diff --git 
a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j1LocationBenchmark.java
 
b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j1LocationBenchmark.java
new file mode 100644
index 0000000..0ef5d41
--- /dev/null
+++ 
b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j1LocationBenchmark.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.perf.jmh;
+
+import java.io.File;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.logging.log4j.perf.util.BenchmarkMessageParams;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.TearDown;
+
+/**
+ * Tests Log4j-1.2 Async Appender performance when including caller location 
information.
+ */
+// ============================== HOW TO RUN THIS TEST: 
====================================
+//
+// single thread:
+// java -jar log4j-perf/target/benchmarks.jar 
".*AsyncAppenderLog4j1LocationBenchmark.*" -f 1 -wi 10 -i 20
+//
+// multiple threads (for example, 4 threads):
+// java -jar log4j-perf/target/benchmarks.jar 
".*AsyncAppenderLog4j1LocationBenchmark.*" -f 1 -wi 10 -i 20 -t 4 -si true
+//
+// Usage help:
+// java -jar log4j-perf/target/benchmarks.jar -help
+//
+@State(Scope.Benchmark)
+public class AsyncAppenderLog4j1LocationBenchmark {
+    Logger logger;
+
+    @Setup(Level.Trial)
+    public void up() {
+        System.setProperty("log4j.configuration", 
"perf-log4j12-async-location-noOpAppender.xml");
+        logger = LogManager.getLogger(getClass());
+    }
+
+    @TearDown(Level.Trial)
+    public void down() {
+        LogManager.shutdown();
+        new File("perftest.log").delete();
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughputSimple() {
+        logger.info(BenchmarkMessageParams.TEST);
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bd4558b8/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j2LocationBenchmark.java
----------------------------------------------------------------------
diff --git 
a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j2LocationBenchmark.java
 
b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j2LocationBenchmark.java
new file mode 100644
index 0000000..c306ac1
--- /dev/null
+++ 
b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j2LocationBenchmark.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.perf.jmh;
+
+import java.io.File;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.LifeCycle;
+import org.apache.logging.log4j.perf.util.BenchmarkMessageParams;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.TearDown;
+
+import static org.apache.logging.log4j.perf.util.BenchmarkMessageParams.*;
+
+/**
+ * Tests Log4j2 Async Appender performance when including caller location 
information.
+ */
+// ============================== HOW TO RUN THIS TEST: 
====================================
+//
+// single thread:
+// java -jar log4j-perf/target/benchmarks.jar 
".*AsyncAppenderLog4j2LocationBenchmark.*" -f 1 -wi 10 -i 20
+//
+// multiple threads (for example, 4 threads):
+// java -jar log4j-perf/target/benchmarks.jar 
".*AsyncAppenderLog4j2LocationBenchmark.*" -f 1 -wi 10 -i 20 -t 4 -si true
+//
+// Usage help:
+// java -jar log4j-perf/target/benchmarks.jar -help
+//
+@State(Scope.Benchmark)
+public class AsyncAppenderLog4j2LocationBenchmark {
+    Logger logger;
+
+    @Setup(Level.Trial)
+    public void up() {
+        System.setProperty("log4j.configurationFile", 
"perf5AsyncApndWithLoc-noOpAppender.xml");
+        logger = LogManager.getLogger(getClass());
+    }
+
+    @TearDown(Level.Trial)
+    public void down() {
+        ((LifeCycle) LogManager.getContext(false)).stop();
+        new File("perftest.log").delete();
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughputSimple() {
+        logger.info(BenchmarkMessageParams.TEST);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bd4558b8/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLogbackLocationBenchmark.java
----------------------------------------------------------------------
diff --git 
a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLogbackLocationBenchmark.java
 
b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLogbackLocationBenchmark.java
new file mode 100644
index 0000000..708bc24
--- /dev/null
+++ 
b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLogbackLocationBenchmark.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.perf.jmh;
+
+import java.io.File;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.logging.log4j.perf.util.BenchmarkMessageParams;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.TearDown;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import ch.qos.logback.core.spi.LifeCycle;
+
+import static org.apache.logging.log4j.perf.util.BenchmarkMessageParams.*;
+
+/**
+ * Tests Logback Async Appender performance when including caller location 
information.
+ */
+// ============================== HOW TO RUN THIS TEST: 
====================================
+//
+// single thread:
+// java -jar log4j-perf/target/benchmarks.jar 
".*AsyncAppenderLogbackLocationBenchmark.*" -f 1 -wi 10 -i 20
+//
+// multiple threads (for example, 4 threads):
+// java -jar log4j-perf/target/benchmarks.jar 
".*AsyncAppenderLogbackLocationBenchmark.*" -f 1 -wi 10 -i 20 -t 4 -si true
+//
+// Usage help:
+// java -jar log4j-perf/target/benchmarks.jar -help
+//
+@State(Scope.Benchmark)
+public class AsyncAppenderLogbackLocationBenchmark {
+
+    private Logger logger;
+
+    @Setup(Level.Trial)
+    public void up() {
+        System.setProperty("logback.configurationFile", 
"perf-logback-async-location-noOpAppender.xml");
+        logger = LoggerFactory.getLogger(getClass());
+    }
+
+    @TearDown(Level.Trial)
+    public void down() {
+        ((LifeCycle) LoggerFactory.getILoggerFactory()).stop();
+        new File("perftest.log").delete();
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughputSimple() {
+        logger.info(BenchmarkMessageParams.TEST);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bd4558b8/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncLoggersLocationBenchmark.java
----------------------------------------------------------------------
diff --git 
a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncLoggersLocationBenchmark.java
 
b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncLoggersLocationBenchmark.java
new file mode 100644
index 0000000..92cdeb6
--- /dev/null
+++ 
b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncLoggersLocationBenchmark.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.perf.jmh;
+
+import java.io.File;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.LifeCycle;
+import org.apache.logging.log4j.perf.util.BenchmarkMessageParams;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.TearDown;
+
+import static org.apache.logging.log4j.perf.util.BenchmarkMessageParams.*;
+
+/**
+ * Tests Log4j2 Async Loggers performance.
+ */
+// ============================== HOW TO RUN THIS TEST: 
====================================
+//
+// single thread:
+// java -jar log4j-perf/target/benchmarks.jar 
".*AsyncLoggersLocationBenchmark.*" -f 1 -wi 10 -i 20
+//
+// multiple threads (for example, 4 threads):
+// java -jar log4j-perf/target/benchmarks.jar 
".*AsyncLoggersLocationBenchmark.*" -f 1 -wi 10 -i 20 -t 4 -si true
+//
+// Usage help:
+// java -jar log4j-perf/target/benchmarks.jar -help
+//
+@State(Scope.Thread)
+public class AsyncLoggersLocationBenchmark {
+
+    Logger logger;
+
+    @Setup(Level.Trial)
+    public void up() {
+        System.setProperty("log4j.configurationFile", 
"perf-WithoutAnyAppender-location.xml");
+        System.setProperty("Log4jContextSelector", 
"org.apache.logging.log4j.core.async.AsyncLoggerContextSelector");
+        System.setProperty("AsyncLogger.RingBufferSize", "262144");
+        System.setProperty("AsyncLogger.WaitStrategy", "Yield");
+        //System.setProperty("log4j2.enable.threadlocals", "true");
+        //System.setProperty("log4j.format.msg.async", "true");
+
+        logger = LogManager.getLogger(getClass());
+        new File("perftest.log").delete();
+    }
+
+    @TearDown(Level.Trial)
+    public void down() {
+        ((LifeCycle) LogManager.getContext(false)).stop();
+        new File("perftest.log").delete();
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughputSimple() {
+        logger.info(BenchmarkMessageParams.TEST);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bd4558b8/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/MemoryHandlerJULBenchmark.java
----------------------------------------------------------------------
diff --git 
a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/MemoryHandlerJULBenchmark.java
 
b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/MemoryHandlerJULBenchmark.java
index 707a8c8..18697f7 100644
--- 
a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/MemoryHandlerJULBenchmark.java
+++ 
b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/MemoryHandlerJULBenchmark.java
@@ -35,6 +35,7 @@ import static 
org.apache.logging.log4j.perf.util.BenchmarkMessageParams.*;
 
 /**
  * Tests JUL (java.util.logging) Memory Handler performance.
+ * We explicitly specify the location so that JUL will not try to look up 
caller location information.
  */
 // ============================== HOW TO RUN THIS TEST: 
====================================
 //

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bd4558b8/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/MemoryHandlerJULLocationBenchmark.java
----------------------------------------------------------------------
diff --git 
a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/MemoryHandlerJULLocationBenchmark.java
 
b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/MemoryHandlerJULLocationBenchmark.java
new file mode 100644
index 0000000..bdf1378
--- /dev/null
+++ 
b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/MemoryHandlerJULLocationBenchmark.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.perf.jmh;
+
+import java.util.concurrent.TimeUnit;
+import java.util.logging.LogRecord;
+import java.util.logging.Logger;
+import java.util.logging.MemoryHandler;
+
+import org.apache.logging.log4j.perf.util.BenchmarkMessageParams;
+import org.apache.logging.log4j.perf.util.NoOpJULHandler;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+
+import static org.apache.logging.log4j.perf.util.BenchmarkMessageParams.*;
+
+/**
+ * Tests JUL (java.util.logging) Memory Handler performance when including 
caller location information.
+ */
+// ============================== HOW TO RUN THIS TEST: 
====================================
+//
+// single thread:
+// java -jar log4j-perf/target/benchmarks.jar 
".*MemoryHandlerJULLocationBenchmark.*" -f 1 -wi 10 -i 20
+//
+// multiple threads (for example, 4 threads):
+// java -jar log4j-perf/target/benchmarks.jar 
".*MemoryHandlerJULLocationBenchmark.*" -f 1 -wi 10 -i 20 -t 4 -si true
+//
+// Usage help:
+// java -jar log4j-perf/target/benchmarks.jar -help
+//
+@State(Scope.Benchmark)
+public class MemoryHandlerJULLocationBenchmark {
+
+    Logger logger;
+    MemoryHandler memoryHandler;
+
+    @Setup(Level.Trial)
+    public void up() {
+        memoryHandler = new MemoryHandler(new NoOpJULHandler(), 262144, 
java.util.logging.Level.SEVERE);
+        logger = Logger.getLogger(getClass().getName());
+        logger.setUseParentHandlers(false);
+        logger.addHandler(memoryHandler);
+        logger.setLevel(java.util.logging.Level.ALL);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughputSimple() {
+        LogRecord logRecord = new LogRecord(java.util.logging.Level.INFO, 
BenchmarkMessageParams.TEST);
+        logRecord.getSourceClassName(); // force location
+        logger.log(logRecord);
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bd4558b8/log4j-perf/src/main/resources/perf-WithoutAnyAppender-location.xml
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/resources/perf-WithoutAnyAppender-location.xml 
b/log4j-perf/src/main/resources/perf-WithoutAnyAppender-location.xml
new file mode 100644
index 0000000..e572bad
--- /dev/null
+++ b/log4j-perf/src/main/resources/perf-WithoutAnyAppender-location.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration status="OFF">
+  <Appenders>
+    <NonExistingAppender name="none">
+    </NonExistingAppender>
+  </Appenders>
+  <Loggers>
+    <Root level="info" includeLocation="true">
+      <appender-ref ref="none"/>
+    </Root>
+  </Loggers>
+</Configuration>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bd4558b8/log4j-perf/src/main/resources/perf-log4j12-async-location-noOpAppender.xml
----------------------------------------------------------------------
diff --git 
a/log4j-perf/src/main/resources/perf-log4j12-async-location-noOpAppender.xml 
b/log4j-perf/src/main/resources/perf-log4j12-async-location-noOpAppender.xml
new file mode 100644
index 0000000..951ced8
--- /dev/null
+++ b/log4j-perf/src/main/resources/perf-log4j12-async-location-noOpAppender.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache license, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License. You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the license for the specific language governing permissions and
+  limitations under the license.
+  -->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";>
+    <appender name="NoOp" 
class="org.apache.logging.log4j.perf.util.NoOpLog4jAppender">
+     </appender>
+     <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
+         <param name="BufferSize" value="262144"/>
+         <param name="LocationInfo" value="true"/>
+         <appender-ref ref="NoOp"/>
+     </appender>
+  <root>
+    <priority value="debug" />
+    <appender-ref ref="ASYNC" />
+  </root>
+</log4j:configuration>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bd4558b8/log4j-perf/src/main/resources/perf-logback-async-location-noOpAppender.xml
----------------------------------------------------------------------
diff --git 
a/log4j-perf/src/main/resources/perf-logback-async-location-noOpAppender.xml 
b/log4j-perf/src/main/resources/perf-logback-async-location-noOpAppender.xml
new file mode 100644
index 0000000..cee1540
--- /dev/null
+++ b/log4j-perf/src/main/resources/perf-logback-async-location-noOpAppender.xml
@@ -0,0 +1,31 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache license, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License. You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the license for the specific language governing permissions and
+  limitations under the license.
+  -->
+<configuration>
+
+  <appender name="NoOp" 
class="org.apache.logging.log4j.perf.util.NoOpLogbackAppender">
+  </appender>
+  <appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
+    <queueSize>262144</queueSize>
+    <discardingThreshold>0</discardingThreshold>
+    <includeCallerData>true</includeCallerData>
+    <appender-ref ref="NoOp" />
+  </appender>
+
+  <root level="debug">
+    <appender-ref ref="ASYNC" />
+  </root>
+</configuration>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bd4558b8/log4j-perf/src/main/resources/perf5AsyncApndWithLoc-noOpAppender.xml
----------------------------------------------------------------------
diff --git 
a/log4j-perf/src/main/resources/perf5AsyncApndWithLoc-noOpAppender.xml 
b/log4j-perf/src/main/resources/perf5AsyncApndWithLoc-noOpAppender.xml
new file mode 100644
index 0000000..eac5097
--- /dev/null
+++ b/log4j-perf/src/main/resources/perf5AsyncApndWithLoc-noOpAppender.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache license, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License. You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the license for the specific language governing permissions and
+  limitations under the license.
+  -->
+<Configuration status="OFF">
+  <Appenders>
+    <CountingNoOp name="NoOp">
+    </CountingNoOp>
+    <Async name="Async"  blocking="true" bufferSize="262144" 
includeLocation="true">
+      <appender-ref ref="NoOp"/>
+    </Async>
+  </Appenders>
+  <Loggers>
+    <Root level="info">
+      <appender-ref ref="Async"/>
+    </Root>
+  </Loggers>
+</Configuration>

Reply via email to