[5/8] logging-log4j2 git commit: Do not use our own deprecated code.
Do not use our own deprecated code. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6b9955df Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6b9955df Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6b9955df Branch: refs/heads/master Commit: 6b9955df6b67ae4eb7cda187dac50a88760d7eef Parents: a990c75 Author: ggregoryAuthored: Sun Apr 17 17:04:47 2016 -0700 Committer: ggregory Committed: Sun Apr 17 17:04:47 2016 -0700 -- .../java/org/apache/logging/log4j/core/LoggerUpdateTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6b9955df/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java index eb698ab..574236c 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java @@ -50,7 +50,7 @@ public class LoggerUpdateTest { @Test public void resetLevel() { final org.apache.logging.log4j.Logger logger = context.getLogger("com.apache.test"); -logger.entry(); +logger.traceEntry(); List events = app.getEvents(); assertEquals("Incorrect number of events. Expected 1, actual " + events.size(), 1, events.size()); app.clear(); @@ -62,7 +62,7 @@ public class LoggerUpdateTest { */ loggerConfig.setLevel(Level.DEBUG); ctx.updateLoggers(); // This causes all Loggers to refetch information from their LoggerConfig. -logger.entry(); +logger.traceEntry(); events = app.getEvents(); assertEquals("Incorrect number of events. Expected 0, actual " + events.size(), 0, events.size()); }
[6/8] logging-log4j2 git commit: Remove dead comment.
Remove dead comment. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/ce36b376 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/ce36b376 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/ce36b376 Branch: refs/heads/master Commit: ce36b37661e45c89c861108b6442eb8249ec2248 Parents: 6b9955d Author: ggregoryAuthored: Sun Apr 17 17:13:17 2016 -0700 Committer: ggregory Committed: Sun Apr 17 17:13:17 2016 -0700 -- .../log4j/core/layout/CsvLogEventLayout.java| 213 +-- 1 file changed, 106 insertions(+), 107 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ce36b376/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvLogEventLayout.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvLogEventLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvLogEventLayout.java index ef69f0f..12e0f3d 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvLogEventLayout.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvLogEventLayout.java @@ -1,107 +1,106 @@ -/* - * 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.core.layout; - -import java.io.IOException; -import java.nio.charset.Charset; - -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVPrinter; -import org.apache.commons.csv.QuoteMode; -import org.apache.logging.log4j.core.Layout; -import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.core.config.Configuration; -import org.apache.logging.log4j.core.config.Node; -import org.apache.logging.log4j.core.config.plugins.Plugin; -import org.apache.logging.log4j.core.config.plugins.PluginAttribute; -import org.apache.logging.log4j.core.config.plugins.PluginConfiguration; -import org.apache.logging.log4j.core.config.plugins.PluginFactory; -import org.apache.logging.log4j.status.StatusLogger; - -/** - * A Comma-Separated Value (CSV) layout to log events. - * - * Depends on Apache Commons CSV 1.2. - * - * @since 2.4 - */ -@Plugin(name = "CsvLogEventLayout", category = Node.CATEGORY, elementType = Layout.ELEMENT_TYPE, printObject = true) -public class CsvLogEventLayout extends AbstractCsvLayout { - -public static CsvLogEventLayout createDefaultLayout() { -return new CsvLogEventLayout(null, Charset.forName(DEFAULT_CHARSET), CSVFormat.valueOf(DEFAULT_FORMAT), null, null); -} - -public static CsvLogEventLayout createLayout(final CSVFormat format) { -return new CsvLogEventLayout(null, Charset.forName(DEFAULT_CHARSET), format, null, null); -} - -@PluginFactory -public static CsvLogEventLayout createLayout( -// @formatter:off -@PluginConfiguration final Configuration config, -@PluginAttribute(value = "format", defaultString = DEFAULT_FORMAT) final String format, -@PluginAttribute("delimiter") final Character delimiter, -@PluginAttribute("escape") final Character escape, -@PluginAttribute("quote") final Character quote, -@PluginAttribute("quoteMode") final QuoteMode quoteMode, -@PluginAttribute("nullString") final String nullString, -@PluginAttribute("recordSeparator") final String recordSeparator, -@PluginAttribute(value = "charset", defaultString = DEFAULT_CHARSET) final Charset charset, -@PluginAttribute("header") final String header, -@PluginAttribute("footer") final String footer) -// @formatter:on -{ - -final CSVFormat csvFormat = createFormat(format, delimiter, escape, quote, quoteMode, nullString, recordSeparator); -return new CsvLogEventLayout(config, charset, csvFormat, header, footer); -} - -protected CsvLogEventLayout(final
[4/8] logging-log4j2 git commit: Fix per Matt's comments on the ML.
Fix per Matt's comments on the ML. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a990c752 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a990c752 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a990c752 Branch: refs/heads/master Commit: a990c75251bdc28123b48ceb67e54f7face71af7 Parents: 7380b27 Author: ggregoryAuthored: Sun Apr 17 17:03:45 2016 -0700 Committer: ggregory Committed: Sun Apr 17 17:03:45 2016 -0700 -- .../log4j/core/net/server/TcpSocketServer.java | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a990c752/log4j-core/src/main/java/org/apache/logging/log4j/core/net/server/TcpSocketServer.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/server/TcpSocketServer.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/server/TcpSocketServer.java index 9103a01..f32fbe8 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/server/TcpSocketServer.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/server/TcpSocketServer.java @@ -32,6 +32,7 @@ import java.util.concurrent.ConcurrentMap; import org.apache.logging.log4j.core.config.ConfigurationFactory; import org.apache.logging.log4j.core.util.Log4jThread; +import org.apache.logging.log4j.message.EntryMessage; /** * Listens for events over a socket connection. @@ -56,7 +57,7 @@ public class TcpSocketServer extends AbstractSocketServer @Override public void run() { -logger.traceEntry(); +final EntryMessage entry = logger.traceEntry(); boolean closed = false; try { try { @@ -80,7 +81,7 @@ public class TcpSocketServer extends AbstractSocketServer } finally { handlers.remove(Long.valueOf(getId())); } -logger.traceExit(); +logger.traceExit(entry); } public void shutdown() { @@ -218,7 +219,7 @@ public class TcpSocketServer extends AbstractSocketServer */ @Override public void run() { -logger.traceEntry(); +final EntryMessage entry = logger.traceEntry(); while (isActive()) { if (serverSocket.isClosed()) { return; @@ -240,14 +241,14 @@ public class TcpSocketServer extends AbstractSocketServer } catch (final IOException e) { if (serverSocket.isClosed()) { // OK we're done. -logger.traceExit(); +logger.traceExit(entry); return; } logger.error("Exception encountered on accept. Ignoring. Stack Trace :", e); } } -for (final Map.Entry entry : handlers.entrySet()) { -final SocketHandler handler = entry.getValue(); +for (final Map.Entry handlerEntry : handlers.entrySet()) { +final SocketHandler handler = handlerEntry.getValue(); handler.shutdown(); try { handler.join(); @@ -255,7 +256,7 @@ public class TcpSocketServer extends AbstractSocketServer // Ignore the exception } } -logger.traceExit(); +logger.traceExit(entry); } /** @@ -264,10 +265,10 @@ public class TcpSocketServer extends AbstractSocketServer * @throws IOException if the server socket could not be closed */ public void shutdown() throws IOException { -logger.traceEntry(); +final EntryMessage entry = logger.traceEntry(); setActive(false); Thread.currentThread().interrupt(); serverSocket.close(); -logger.traceExit(); +logger.traceExit(entry); } }
[3/8] logging-log4j2 git commit: Add traceEntry/Exit() tests.
Add traceEntry/Exit() tests. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/7380b27e Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/7380b27e Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/7380b27e Branch: refs/heads/master Commit: 7380b27e15465d943cdeecb6ec35430859406256 Parents: b61fbbd Author: ggregoryAuthored: Sun Apr 17 16:59:03 2016 -0700 Committer: ggregory Committed: Sun Apr 17 16:59:03 2016 -0700 -- .../java/org/apache/logging/log4j/core/LoggerTest.java | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7380b27e/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java index 7ba6a89..7a2e01e 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java @@ -89,8 +89,8 @@ public class LoggerTest { @Test public void basicFlow() { -logger.entry(); -logger.exit(); +logger.traceEntry(); +logger.traceExit(); final List events = app.getEvents(); assertEventCount(events, 2); } @@ -98,6 +98,14 @@ public class LoggerTest { @Test public void simpleFlow() { logger.entry(CONFIG); +logger.traceExit(0); +final List events = app.getEvents(); +assertEventCount(events, 2); +} + +@Test +public void simpleFlowDepreacted() { +logger.entry(CONFIG); logger.exit(0); final List events = app.getEvents(); assertEventCount(events, 2);
[2/8] logging-log4j2 git commit: Remove unused imports.
Remove unused imports. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/b61fbbd4 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/b61fbbd4 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/b61fbbd4 Branch: refs/heads/master Commit: b61fbbd4c4516fea90fedeb22777ac13cd089b1b Parents: a7f60a2 Author: ggregoryAuthored: Sun Apr 17 16:56:39 2016 -0700 Committer: ggregory Committed: Sun Apr 17 16:56:39 2016 -0700 -- .../apache/logging/log4j/core/appender/MemoryMappedFileManager.java | 1 - .../apache/logging/log4j/core/appender/RandomAccessFileManager.java | 1 - .../log4j/core/appender/rolling/RollingRandomAccessFileManager.java | 1 - 3 files changed, 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b61fbbd4/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java index 1986993..cfb5a08 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java @@ -34,7 +34,6 @@ import java.util.Map; import java.util.Objects; import org.apache.logging.log4j.core.Layout; -import org.apache.logging.log4j.core.layout.ByteBufferDestination; import org.apache.logging.log4j.core.util.Closer; import org.apache.logging.log4j.core.util.NullOutputStream; http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b61fbbd4/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java index 674c25f..265aef0 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java @@ -26,7 +26,6 @@ import java.util.HashMap; import java.util.Map; import org.apache.logging.log4j.core.Layout; -import org.apache.logging.log4j.core.layout.ByteBufferDestination; import org.apache.logging.log4j.core.util.NullOutputStream; /** http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b61fbbd4/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java index e76dba6..7a3e43d 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java @@ -26,7 +26,6 @@ import java.nio.ByteBuffer; import org.apache.logging.log4j.core.Layout; import org.apache.logging.log4j.core.appender.AppenderLoggingException; import org.apache.logging.log4j.core.appender.ManagerFactory; -import org.apache.logging.log4j.core.layout.ByteBufferDestination; import org.apache.logging.log4j.core.util.NullOutputStream; /**
[8/8] logging-log4j2 git commit: Do not use our own deprecated code.
Do not use our own deprecated code. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d3e571f3 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d3e571f3 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d3e571f3 Branch: refs/heads/master Commit: d3e571f37bd9a2ef07e426a1809d3cb1f69c3482 Parents: a15477b Author: ggregoryAuthored: Sun Apr 17 17:26:34 2016 -0700 Committer: ggregory Committed: Sun Apr 17 17:26:34 2016 -0700 -- .../logging/log4j/core/AppenderRefLevelJsonTest.java | 12 ++-- .../logging/log4j/core/AppenderRefLevelTest.java | 12 ++-- .../apache/logging/log4j/core/PatternSelectorTest.java | 12 ++-- .../apache/logging/log4j/core/StrictXmlConfigTest.java | 13 +++-- .../log4j/core/filter/AbstractScriptFilterTest.java| 4 ++-- 5 files changed, 31 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d3e571f3/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelJsonTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelJsonTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelJsonTest.java index a6c7697..3d9424a 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelJsonTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelJsonTest.java @@ -52,36 +52,36 @@ public class AppenderRefLevelJsonTest { @Test public void logger1() { -logger1.entry(); +logger1.traceEntry(); logger1.debug("debug message"); logger1.error("Test Message"); logger1.info("Info Message"); logger1.warn("warn Message"); -logger1.exit(); +logger1.traceExit(); assertThat(app1.getEvents(), hasSize(6)); assertThat(app2.getEvents(), hasSize(1)); } @Test public void logger2() { -logger2.entry(); +logger2.traceEntry(); logger2.debug("debug message"); logger2.error("Test Message"); logger2.info("Info Message"); logger2.warn("warn Message"); -logger2.exit(); +logger2.traceExit(); assertThat(app1.getEvents(), hasSize(2)); assertThat(app2.getEvents(), hasSize(4)); } @Test public void logger3() { -logger3.entry(); +logger3.traceEntry(); logger3.debug(testMarker, "debug message"); logger3.error("Test Message"); logger3.info(testMarker, "Info Message"); logger3.warn("warn Message"); -logger3.exit(); +logger3.traceExit(); assertThat(app1.getEvents(), hasSize(4)); } } http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d3e571f3/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java index d59c1a0..861ed87 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java @@ -53,12 +53,12 @@ public class AppenderRefLevelTest { @Test public void logger1() { -logger1.entry(); +logger1.traceEntry(); logger1.debug("debug message"); logger1.error("Test Message"); logger1.info("Info Message"); logger1.warn("warn Message"); -logger1.exit(); +logger1.traceExit(); List events = app1.getEvents(); assertEquals("Incorrect number of events. Expected 6, actual " + events.size(), 6, events.size()); events = app2.getEvents(); @@ -67,12 +67,12 @@ public class AppenderRefLevelTest { @Test public void logger2() { -logger2.entry(); +logger2.traceEntry(); logger2.debug("debug message"); logger2.error("Test Message"); logger2.info("Info Message"); logger2.warn("warn Message"); -logger2.exit(); +logger2.traceExit(); List events = app1.getEvents(); assertEquals("Incorrect number of events. Expected 2, actual " + events.size(), events.size(), 2); events = app2.getEvents(); @@ -81,12 +81,12 @@ public class AppenderRefLevelTest { @Test public void logger3() { -logger3.entry(); +logger3.traceEntry(); logger3.debug(testMarker, "debug
[7/8] logging-log4j2 git commit: Remove dead comment.
Remove dead comment. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a15477ba Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a15477ba Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a15477ba Branch: refs/heads/master Commit: a15477ba51bac258238a23cc3fd837cb1a57d1a2 Parents: ce36b37 Author: ggregoryAuthored: Sun Apr 17 17:13:36 2016 -0700 Committer: ggregory Committed: Sun Apr 17 17:13:36 2016 -0700 -- .../log4j/core/layout/CsvParameterLayout.java | 207 +-- 1 file changed, 103 insertions(+), 104 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a15477ba/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvParameterLayout.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvParameterLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvParameterLayout.java index 9c792e7..dcae328 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvParameterLayout.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/CsvParameterLayout.java @@ -1,104 +1,103 @@ -/* - * 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.core.layout; - -import java.io.IOException; -import java.nio.charset.Charset; - -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVPrinter; -import org.apache.commons.csv.QuoteMode; -import org.apache.logging.log4j.core.Layout; -import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.core.config.Configuration; -import org.apache.logging.log4j.core.config.Node; -import org.apache.logging.log4j.core.config.plugins.Plugin; -import org.apache.logging.log4j.core.config.plugins.PluginAttribute; -import org.apache.logging.log4j.core.config.plugins.PluginConfiguration; -import org.apache.logging.log4j.core.config.plugins.PluginFactory; -import org.apache.logging.log4j.message.Message; -import org.apache.logging.log4j.status.StatusLogger; - -/** - * A Comma-Separated Value (CSV) layout to log event parameters. - * The event message is currently ignored. - * - * - * Best used with: - * - * - * {@code logger.debug(new ObjectArrayMessage(1, 2, "Bob"));} - * - * - * Depends on Apache Commons CSV 1.2. - * - * @since 2.4 - */ -@Plugin(name = "CsvParameterLayout", category = Node.CATEGORY, elementType = Layout.ELEMENT_TYPE, printObject = true) -public class CsvParameterLayout extends AbstractCsvLayout { - -public static AbstractCsvLayout createDefaultLayout() { -return new CsvParameterLayout(null, Charset.forName(DEFAULT_CHARSET), CSVFormat.valueOf(DEFAULT_FORMAT), null, null); -} - -public static AbstractCsvLayout createLayout(final CSVFormat format) { -return new CsvParameterLayout(null, Charset.forName(DEFAULT_CHARSET), format, null, null); -} - -@PluginFactory -public static AbstractCsvLayout createLayout( -// @formatter:off -@PluginConfiguration final Configuration config, -@PluginAttribute(value = "format", defaultString = DEFAULT_FORMAT) final String format, -@PluginAttribute("delimiter") final Character delimiter, -@PluginAttribute("escape") final Character escape, -@PluginAttribute("quote") final Character quote, -@PluginAttribute("quoteMode") final QuoteMode quoteMode, -@PluginAttribute("nullString") final String nullString, -@PluginAttribute("recordSeparator") final String recordSeparator, -@PluginAttribute(value = "charset", defaultString = DEFAULT_CHARSET) final Charset charset, -@PluginAttribute("header") final String header, -@PluginAttribute("footer") final String footer) -// @formatter:on -{ - -final CSVFormat csvFormat =
[1/8] logging-log4j2 git commit: Statement unnecessarily nested.
Repository: logging-log4j2 Updated Branches: refs/heads/master 9a563a63f -> d3e571f37 Statement unnecessarily nested. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a7f60a25 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a7f60a25 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a7f60a25 Branch: refs/heads/master Commit: a7f60a25a89126cd183ed5181ab526fcfbd213c2 Parents: 9a563a6 Author: ggregoryAuthored: Sun Apr 17 16:55:32 2016 -0700 Committer: ggregory Committed: Sun Apr 17 16:55:32 2016 -0700 -- .../appender/rolling/action/DeleteAction.java | 432 +-- .../logging/log4j/core/impl/Log4jLogEvent.java | 3 +- .../logging/log4j/core/layout/GelfLayout.java | 9 +- .../core/pattern/DatePatternConverter.java | 3 +- 4 files changed, 220 insertions(+), 227 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a7f60a25/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeleteAction.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeleteAction.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeleteAction.java index c2c385f..8176470 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeleteAction.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeleteAction.java @@ -1,218 +1,214 @@ -/* - * 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.core.appender.rolling.action; - -import java.io.IOException; -import java.nio.file.FileVisitor; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.Objects; - -import org.apache.logging.log4j.core.config.Configuration; -import org.apache.logging.log4j.core.config.plugins.Plugin; -import org.apache.logging.log4j.core.config.plugins.PluginAttribute; -import org.apache.logging.log4j.core.config.plugins.PluginConfiguration; -import org.apache.logging.log4j.core.config.plugins.PluginElement; -import org.apache.logging.log4j.core.config.plugins.PluginFactory; -import org.apache.logging.log4j.core.lookup.StrSubstitutor; - -/** - * Rollover or scheduled action for deleting old log files that are accepted by the specified PathFilters. - */ -@Plugin(name = "Delete", category = "Core", printObject = true) -public class DeleteAction extends AbstractPathAction { - -private final PathSorter pathSorter; -private final boolean testMode; -private final ScriptCondition scriptCondition; - -/** - * Creates a new DeleteAction that starts scanning for files to delete from the specified base path. - * - * @param basePath base path from where to start scanning for files to delete. - * @param followSymbolicLinks whether to follow symbolic links. Default is false. - * @param maxDepth The maxDepth parameter is the maximum number of levels of directories to visit. A value of 0 - *means that only the starting file is visited, unless denied by the security manager. A value of - *MAX_VALUE may be used to indicate that all levels should be visited. - * @param testMode if true, files are not deleted but instead a message is printed to the http://logging.apache.org/log4j/2.x/manual/configuration.html#StatusMessages;>status logger - *at INFO level. Users can use this to do a dry run to test if their configuration works as expected. - * @param sorter sorts - * @param pathConditions an array of path filters (if more than one, they all need to accept a path before it is - *deleted). - * @param scriptCondition - */ -DeleteAction(final String basePath, final boolean followSymbolicLinks, final int maxDepth, final boolean testMode, -
logging-log4j2 git commit: Unnecessary cast.
Repository: logging-log4j2 Updated Branches: refs/heads/master 5f692411a -> 9a563a63f Unnecessary cast. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/9a563a63 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/9a563a63 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/9a563a63 Branch: refs/heads/master Commit: 9a563a63f80d7daa6c16c19015187d5deb624cf7 Parents: 5f69241 Author: ggregoryAuthored: Sun Apr 17 16:53:37 2016 -0700 Committer: ggregory Committed: Sun Apr 17 16:53:37 2016 -0700 -- .../log4j/core/appender/RollingRandomAccessFileAppender.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/9a563a63/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java index e624985..dc92d7e 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java @@ -84,7 +84,7 @@ public final class RollingRandomAccessFileAppender extends AbstractOutputStreamA */ @Override public void append(final LogEvent event) { -final RollingRandomAccessFileManager manager = (RollingRandomAccessFileManager) getManager(); +final RollingRandomAccessFileManager manager = getManager(); manager.checkRollover(event); // Leverage the nice batching behaviour of async Loggers/Appenders:
logging-log4j2 git commit: Do not use our own deprecated code.
Repository: logging-log4j2 Updated Branches: refs/heads/master f30bd69f8 -> 5f692411a Do not use our own deprecated code. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/5f692411 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/5f692411 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/5f692411 Branch: refs/heads/master Commit: 5f692411a4568946ae4dfe053c9de19635dde18e Parents: f30bd69 Author: ggregoryAuthored: Sun Apr 17 16:52:55 2016 -0700 Committer: ggregory Committed: Sun Apr 17 16:52:55 2016 -0700 -- .../log4j/core/net/server/TcpSocketServer.java| 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5f692411/log4j-core/src/main/java/org/apache/logging/log4j/core/net/server/TcpSocketServer.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/server/TcpSocketServer.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/server/TcpSocketServer.java index db5917c..9103a01 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/server/TcpSocketServer.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/server/TcpSocketServer.java @@ -56,7 +56,7 @@ public class TcpSocketServer extends AbstractSocketServer @Override public void run() { -logger.entry(); +logger.traceEntry(); boolean closed = false; try { try { @@ -80,7 +80,7 @@ public class TcpSocketServer extends AbstractSocketServer } finally { handlers.remove(Long.valueOf(getId())); } -logger.exit(); +logger.traceExit(); } public void shutdown() { @@ -218,7 +218,7 @@ public class TcpSocketServer extends AbstractSocketServer */ @Override public void run() { -logger.entry(); +logger.traceEntry(); while (isActive()) { if (serverSocket.isClosed()) { return; @@ -240,7 +240,7 @@ public class TcpSocketServer extends AbstractSocketServer } catch (final IOException e) { if (serverSocket.isClosed()) { // OK we're done. -logger.exit(); +logger.traceExit(); return; } logger.error("Exception encountered on accept. Ignoring. Stack Trace :", e); @@ -255,7 +255,7 @@ public class TcpSocketServer extends AbstractSocketServer // Ignore the exception } } -logger.exit(); +logger.traceExit(); } /** @@ -264,10 +264,10 @@ public class TcpSocketServer extends AbstractSocketServer * @throws IOException if the server socket could not be closed */ public void shutdown() throws IOException { -logger.entry(); +logger.traceEntry(); setActive(false); Thread.currentThread().interrupt(); serverSocket.close(); -logger.exit(); +logger.traceExit(); } }
logging-log4j2 git commit: Replace depreacted test code with EasyMock.newCapture().
Repository: logging-log4j2 Updated Branches: refs/heads/master b119e19d0 -> f30bd69f8 Replace depreacted test code with EasyMock.newCapture(). Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f30bd69f Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f30bd69f Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f30bd69f Branch: refs/heads/master Commit: f30bd69f8b20e8aa23b77d96c7bad76d3fe4f55f Parents: b119e19 Author: ggregoryAuthored: Sun Apr 17 16:50:19 2016 -0700 Committer: ggregory Committed: Sun Apr 17 16:50:19 2016 -0700 -- .../appender/NoSqlDatabaseManagerTest.java | 26 ++-- 1 file changed, 19 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f30bd69f/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java -- diff --git a/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java b/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java index 7809451..c3c11d1 100644 --- a/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java +++ b/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java @@ -16,6 +16,21 @@ */ package org.apache.logging.log4j.nosql.appender; +import static org.easymock.EasyMock.anyInt; +import static org.easymock.EasyMock.capture; +import static org.easymock.EasyMock.createStrictMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.expectLastCall; +import static org.easymock.EasyMock.getCurrentArguments; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.reset; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.io.IOException; import java.sql.SQLException; import java.util.Date; @@ -30,15 +45,12 @@ import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.appender.AppenderLoggingException; import org.apache.logging.log4j.message.Message; import org.easymock.Capture; +import org.easymock.EasyMock; import org.easymock.IAnswer; import org.junit.After; import org.junit.Before; import org.junit.Test; -import static org.easymock.EasyMock.*; - -import static org.junit.Assert.*; - public class NoSqlDatabaseManagerTest { private NoSqlConnection
logging-log4j2 git commit: Add traceEntry/Exit() tests.
Repository: logging-log4j2 Updated Branches: refs/heads/master b285279a1 -> 8f1e0b23d Add traceEntry/Exit() tests. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/8f1e0b23 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/8f1e0b23 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/8f1e0b23 Branch: refs/heads/master Commit: 8f1e0b23dfcf39ff48b64041103d0b403d711ba3 Parents: b285279 Author: ggregoryAuthored: Sun Apr 17 16:45:12 2016 -0700 Committer: ggregory Committed: Sun Apr 17 16:45:12 2016 -0700 -- .../org/apache/logging/slf4j/LoggerTest.java| 360 ++- 1 file changed, 187 insertions(+), 173 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8f1e0b23/log4j-to-slf4j/src/test/java/org/apache/logging/slf4j/LoggerTest.java -- diff --git a/log4j-to-slf4j/src/test/java/org/apache/logging/slf4j/LoggerTest.java b/log4j-to-slf4j/src/test/java/org/apache/logging/slf4j/LoggerTest.java index c061782..77b9c4e 100644 --- a/log4j-to-slf4j/src/test/java/org/apache/logging/slf4j/LoggerTest.java +++ b/log4j-to-slf4j/src/test/java/org/apache/logging/slf4j/LoggerTest.java @@ -1,173 +1,187 @@ - -/* -* 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.slf4j; - -import java.util.Date; -import java.util.List; - -import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.core.testUtil.StringListAppender; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.ThreadContext; -import org.apache.logging.log4j.message.MessageFactory; -import org.apache.logging.log4j.message.ParameterizedMessageFactory; -import org.apache.logging.log4j.message.StringFormatterMessageFactory; -import org.apache.logging.log4j.spi.AbstractLogger; -import org.apache.logging.log4j.spi.MessageFactory2Adapter; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Test; - -import static org.hamcrest.Matchers.*; -import static org.junit.Assert.*; - -/** - * - */ -public class LoggerTest { - -private static final String CONFIG = "target/test-classes/logback-slf4j.xml"; - -@ClassRule -public static final LoggerContextRule CTX = new LoggerContextRule(CONFIG); - -private Logger logger; -private StringListAppender list; - -@Before -public void setUp() throws Exception { -final org.slf4j.Logger slf4jLogger = CTX.getLogger(); -logger = LogManager.getLogger(); -assertThat(slf4jLogger, is(theInstance(((SLF4JLogger) logger).getLogger(; -final ch.qos.logback.classic.Logger rootLogger = CTX.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME); -rootLogger.detachAppender("console"); -list = TestUtil.getListAppender(rootLogger, "LIST"); -assertThat(list, is(notNullValue())); -assertThat(list.strList, is(notNullValue())); -list.strList.clear(); -} - -@Test -public void basicFlow() { -logger.entry(); -logger.exit(); -assertThat(list.strList, hasSize(2)); -} - -@Test -public void simpleFlow() { -logger.entry(CONFIG); -logger.exit(0); -assertThat(list.strList, hasSize(2)); -} - -@Test -public void throwing() { -logger.throwing(new IllegalArgumentException("Test Exception")); -assertThat(list.strList, hasSize(1)); -} - -@Test -public void catching() { -try { -throw new NullPointerException(); -} catch (final Exception e) { -logger.catching(e); -} -assertThat(list.strList, hasSize(1)); -} - -@Test -public void debug() { -logger.debug("Debug message"); -assertThat(list.strList, hasSize(1)); -} - -@Test -public void getLogger_String_MessageFactoryMismatch() { -final Logger testLogger =
logging-log4j2 git commit: Remove redundant interfaces.
Repository: logging-log4j2 Updated Branches: refs/heads/master a6c32c516 -> b285279a1 Remove redundant interfaces. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/b285279a Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/b285279a Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/b285279a Branch: refs/heads/master Commit: b285279a1aa15158da1060a085a6242fe84a2e77 Parents: a6c32c5 Author: ggregoryAuthored: Sun Apr 17 16:41:07 2016 -0700 Committer: ggregory Committed: Sun Apr 17 16:41:07 2016 -0700 -- .../logging/log4j/core/appender/MemoryMappedFileManager.java | 2 +- .../logging/log4j/core/appender/RandomAccessFileManager.java | 2 +- .../core/appender/rolling/RollingRandomAccessFileManager.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b285279a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java index 336b9ee..1986993 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java @@ -56,7 +56,7 @@ import org.apache.logging.log4j.core.util.NullOutputStream; * @since 2.1 */ //CHECKSTYLE:ON -public class MemoryMappedFileManager extends OutputStreamManager implements ByteBufferDestination { +public class MemoryMappedFileManager extends OutputStreamManager { /** * Default length of region to map. */ http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b285279a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java index 6a2bee5..674c25f 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java @@ -34,7 +34,7 @@ import org.apache.logging.log4j.core.util.NullOutputStream; * this class uses a {@code ByteBuffer} and a {@code RandomAccessFile} to do the * I/O. */ -public class RandomAccessFileManager extends OutputStreamManager implements ByteBufferDestination { +public class RandomAccessFileManager extends OutputStreamManager { static final int DEFAULT_BUFFER_SIZE = 256 * 1024; private static final RandomAccessFileManagerFactory FACTORY = new RandomAccessFileManagerFactory(); http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b285279a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java index 39f30be..e76dba6 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java @@ -33,7 +33,7 @@ import org.apache.logging.log4j.core.util.NullOutputStream; * Extends RollingFileManager but instead of using a buffered output stream, this class uses a {@code ByteBuffer} and a * {@code RandomAccessFile} to do the I/O. */ -public class RollingRandomAccessFileManager extends RollingFileManager implements ByteBufferDestination { +public class RollingRandomAccessFileManager extends RollingFileManager { /** * The default buffer size. */
logging-log4j2 git commit: Use Java 7 diamonds.
Repository: logging-log4j2 Updated Branches: refs/heads/master f275612d5 -> a6c32c516 Use Java 7 diamonds. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a6c32c51 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a6c32c51 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a6c32c51 Branch: refs/heads/master Commit: a6c32c5166db9bf7efc56ff34005511360715c7b Parents: f275612 Author: ggregoryAuthored: Sun Apr 17 16:39:39 2016 -0700 Committer: ggregory Committed: Sun Apr 17 16:39:39 2016 -0700 -- .../log4j/perf/jmh/LoggerConfigBenchmark.java | 2 +- ...ThreadLocalVsConcurrentHashMapBenchmark.java | 186 +-- 2 files changed, 94 insertions(+), 94 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a6c32c51/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/LoggerConfigBenchmark.java -- diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/LoggerConfigBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/LoggerConfigBenchmark.java index 161d4d1..0321b04 100644 --- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/LoggerConfigBenchmark.java +++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/LoggerConfigBenchmark.java @@ -51,7 +51,7 @@ import org.openjdk.jmh.infra.Blackhole; @State(Scope.Benchmark) public class LoggerConfigBenchmark { -private final CopyOnWriteArraySet appenderSet = new CopyOnWriteArraySet(); +private final CopyOnWriteArraySet appenderSet = new CopyOnWriteArraySet<>(); private volatile Filter filter = null; private final boolean additive = true; private final boolean includeLocation = true; http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a6c32c51/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadLocalVsConcurrentHashMapBenchmark.java -- diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadLocalVsConcurrentHashMapBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadLocalVsConcurrentHashMapBenchmark.java index 7ba0ca4..7d1ccc9 100644 --- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadLocalVsConcurrentHashMapBenchmark.java +++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadLocalVsConcurrentHashMapBenchmark.java @@ -1,94 +1,94 @@ -/* - * 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.ConcurrentHashMap; - -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.Scope; -import org.openjdk.jmh.annotations.State; - -/** - * Compares performance of ThreadLocal, vs ConcurrentHashMapThread, Object. - */ -// == HOW TO RUN THIS TEST: -// (Quick build: mvn -DskipTests=true clean package -pl log4j-perf -am ) -// -// single thread: -// java -jar log4j-perf/target/benchmarks.jar ".*ThreadLocalVsConcurrentHashMap.*" -f 1 -wi 10 -i 20 -tu ns -bm sample -// -// four threads: -// java -jar log4j-perf/target/benchmarks.jar ".*ThreadLocalVsConcurrentHashMap.*" -f 1 -wi 10 -i 20 -tu ns -bm sample -// -t 4 -// -// Usage help: -// java -jar log4j-perf/target/benchmarks.jar -help -// -@State(Scope.Benchmark) -public class ThreadLocalVsConcurrentHashMapBenchmark { - -private static final String VALUE = "value"; -private static ConcurrentHashMap map = new ConcurrentHashMap (); -private static ThreadLocal threadLocal = new ThreadLocal<>(); - -@Benchmark -public String newInstance() { -StringBuilder sb = getNew(); -sb.append(VALUE); -return sb.toString(); -} - -@Benchmark -public String threadLocal() { -
logging-log4j2 git commit: Use Java 7 diamonds.
Repository: logging-log4j2 Updated Branches: refs/heads/master 661e11790 -> f275612d5 Use Java 7 diamonds. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f275612d Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f275612d Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f275612d Branch: refs/heads/master Commit: f275612d595642c9a95c2e8a313cf17741b3e2de Parents: 661e117 Author: ggregoryAuthored: Sun Apr 17 16:39:02 2016 -0700 Committer: ggregory Committed: Sun Apr 17 16:39:02 2016 -0700 -- .../logging/log4j/perf/jmh/CollectionsBenchmark.java| 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f275612d/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/CollectionsBenchmark.java -- diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/CollectionsBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/CollectionsBenchmark.java index 37fa593..ea40dac 100644 --- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/CollectionsBenchmark.java +++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/CollectionsBenchmark.java @@ -39,12 +39,12 @@ import org.openjdk.jmh.infra.Blackhole; // @State(Scope.Benchmark) public class CollectionsBenchmark { -private final ConcurrentHashMap map1 = new ConcurrentHashMap (); -private final CopyOnWriteArraySet arraySet1 = new CopyOnWriteArraySet(); -private final CopyOnWriteArrayList arrayList1 = new CopyOnWriteArrayList(); -private final ConcurrentHashMap map3 = new ConcurrentHashMap (); -private final CopyOnWriteArraySet arraySet3 = new CopyOnWriteArraySet(); -private final CopyOnWriteArrayList arrayList3 = new CopyOnWriteArrayList(); +private final ConcurrentHashMap map1 = new ConcurrentHashMap<>(); +private final CopyOnWriteArraySet arraySet1 = new CopyOnWriteArraySet<>(); +private final CopyOnWriteArrayList arrayList1 = new CopyOnWriteArrayList<>(); +private final ConcurrentHashMap map3 = new ConcurrentHashMap<>(); +private final CopyOnWriteArraySet arraySet3 = new CopyOnWriteArraySet<>(); +private final CopyOnWriteArrayList arrayList3 = new CopyOnWriteArrayList<>(); @Setup public void setup() {
[2/2] logging-log4j2 git commit: Add final modifier to private fields.
Add final modifier to private fields. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/661e1179 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/661e1179 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/661e1179 Branch: refs/heads/master Commit: 661e11790dd6e9663d9a3696cf8cb26afd47e4d8 Parents: fe80be3 Author: ggregoryAuthored: Sun Apr 17 16:32:48 2016 -0700 Committer: ggregory Committed: Sun Apr 17 16:32:48 2016 -0700 -- .../apache/logging/log4j/perf/jmh/TextEncoderHelperBenchmark.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/661e1179/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/TextEncoderHelperBenchmark.java -- diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/TextEncoderHelperBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/TextEncoderHelperBenchmark.java index 888035d..7fd83fd 100644 --- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/TextEncoderHelperBenchmark.java +++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/TextEncoderHelperBenchmark.java @@ -117,7 +117,7 @@ public class TextEncoderHelperBenchmark { } //private static final ThreadLocal textEncoderHelper = new ThreadLocal<>(); -private StringBuilderEncoder textEncoderHelper = new StringBuilderEncoder(CHARSET_DEFAULT); +private final StringBuilderEncoder textEncoderHelper = new StringBuilderEncoder(CHARSET_DEFAULT); private StringBuilderEncoder getEncoder() { StringBuilderEncoder result = textEncoderHelper; return result;
logging-log4j2 git commit: Add missing '@Override' annotations to implementations of interface methods.
Repository: logging-log4j2 Updated Branches: refs/heads/master 99b5a5def -> 87780643c Add missing '@Override' annotations to implementations of interface methods. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/87780643 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/87780643 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/87780643 Branch: refs/heads/master Commit: 87780643c73606f9d6a43f0ed53cdf3355857597 Parents: 99b5a5d Author: ggregoryAuthored: Sun Apr 17 16:29:28 2016 -0700 Committer: ggregory Committed: Sun Apr 17 16:29:28 2016 -0700 -- .../java/org/apache/logging/log4j/core/GcFreeLoggingTestUtil.java | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/87780643/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTestUtil.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTestUtil.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTestUtil.java index e5b205c..e6517ed 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTestUtil.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTestUtil.java @@ -67,6 +67,7 @@ public class GcFreeLoggingTestUtil { "com/google/monitoring/runtime/instrumentation/Sampler", // }; final Sampler sampler = new Sampler() { +@Override public void sampleAllocation(int count, String desc, Object newObj, long size) { for (int i = 0; i < exclude.length; i++) { if (exclude[i].equals(desc)) {
logging-log4j2 git commit: Add missing '@Override' annotations.
Repository: logging-log4j2 Updated Branches: refs/heads/master ffbd8c9b2 -> 99b5a5def Add missing '@Override' annotations. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/99b5a5de Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/99b5a5de Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/99b5a5de Branch: refs/heads/master Commit: 99b5a5defb1a1e6640da1ede814b6d3c9897bbe2 Parents: ffbd8c9 Author: ggregoryAuthored: Sun Apr 17 16:28:52 2016 -0700 Committer: ggregory Committed: Sun Apr 17 16:28:52 2016 -0700 -- .../src/test/java/org/apache/logging/log4j/util/UnboxTest.java | 2 ++ .../logging/log4j/core/appender/rolling/PatternProcessor.java | 1 + .../logging/log4j/core/async/perftest/SimpleLatencyTest.java | 1 + .../org/apache/logging/log4j/core/jackson/LevelMixInJsonTest.java | 1 + 4 files changed, 5 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/99b5a5de/log4j-api/src/test/java/org/apache/logging/log4j/util/UnboxTest.java -- diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/UnboxTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/UnboxTest.java index 966fa6a..e0b2766 100644 --- a/log4j-api/src/test/java/org/apache/logging/log4j/util/UnboxTest.java +++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/UnboxTest.java @@ -119,6 +119,7 @@ public class UnboxTest { final StringBuilder[] probe = new StringBuilder[16 * 3]; populate(0, probe); Thread t1 = new Thread() { +@Override public void run() { populate(16, probe); } @@ -126,6 +127,7 @@ public class UnboxTest { t1.start(); t1.join(); Thread t2 = new Thread() { +@Override public void run() { populate(16, probe); } http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/99b5a5de/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java index e441c69..0dee11e 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java @@ -64,6 +64,7 @@ public class PatternProcessor { return pattern; } +@Override public String toString() { return pattern; } http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/99b5a5de/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimpleLatencyTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimpleLatencyTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimpleLatencyTest.java index 1a306b1..90341ad 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimpleLatencyTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimpleLatencyTest.java @@ -111,6 +111,7 @@ public class SimpleLatencyTest { final Histogram hist = new Histogram(TimeUnit.SECONDS.toNanos(10), 3); histograms.add(hist); final Thread t = new Thread("latencytest-" + i) { +@Override public void run() { LATCH.countDown(); try { http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/99b5a5de/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/LevelMixInJsonTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/LevelMixInJsonTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/LevelMixInJsonTest.java index 55853fa..f2e63e5 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/LevelMixInJsonTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/jackson/LevelMixInJsonTest.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; public class LevelMixInJsonTest extends LevelMixInTest { +@Override protected ObjectMapper newObjectMapper() { return new Log4jJsonObjectMapper(); }
[2/4] logging-log4j2 git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/logging-log4j2.git
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/logging-log4j2.git Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/98cc7d27 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/98cc7d27 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/98cc7d27 Branch: refs/heads/master Commit: 98cc7d27c6d49da3f81ae6ff8cee2f4b0a4009e5 Parents: 80a4398 3c37ca3 Author: ggregoryAuthored: Sun Apr 17 15:27:42 2016 -0700 Committer: ggregory Committed: Sun Apr 17 15:27:42 2016 -0700 -- .../ParameterizedNoReferenceMessageFactory.java | 39 - log4j-core/pom.xml | 5 + .../log4j/core/appender/AsyncAppender.java | 28 +-- .../log4j/core/appender/FileManager.java| 3 +- .../core/appender/OutputStreamManager.java | 7 +- .../appender/rolling/RollingFileManager.java| 4 +- .../log4j/core/async/AsyncLoggerConfig.java | 1 + .../core/async/AsyncLoggerConfigDelegate.java | 10 ++ .../core/async/AsyncLoggerConfigDisruptor.java | 66 +++- .../logging/log4j/core/async/EventRoute.java| 9 +- .../log4j/core/async/RingBufferLogEvent.java| 15 +- .../core/async/ThreadNameCachingStrategy.java | 4 +- .../logging/log4j/core/config/LoggerConfig.java | 5 +- .../log4j/core/impl/MutableLogEvent.java| 46 +++-- .../core/impl/ReusableLogEventFactory.java | 34 ++-- .../log4j/core/jackson/Initializers.java| 2 +- .../core/layout/AbstractJacksonLayout.java | 17 +- .../core/layout/ByteBufferDestination.java | 8 +- .../log4j/core/layout/JacksonFactory.java | 2 +- .../layout/LockingStringBuilderEncoder.java | 3 +- .../log4j/core/layout/StringBuilderEncoder.java | 3 +- .../log4j/core/layout/TextEncoderHelper.java| 1 - .../logging/log4j/core/net/SmtpManager.java | 5 +- .../ExtendedThrowablePatternConverter.java | 5 +- .../pattern/RootThrowablePatternConverter.java | 5 +- .../logging/log4j/core/util/Constants.java | 45 - .../core/GcFreeAsynchronousLoggingTest.java | 41 + .../logging/log4j/core/GcFreeLoggingTest.java | 167 -- .../log4j/core/GcFreeLoggingTestUtil.java | 169 +++ .../core/GcFreeMixedSyncAyncLoggingTest.java| 58 +++ .../core/GcFreeSynchronousLoggingTest.java | 58 +++ .../log4j/core/async/perftest/IdleStrategy.java | 43 + .../core/async/perftest/NoOpIdleStrategy.java | 34 .../core/async/perftest/SimpleLatencyTest.java | 118 + .../log4j/core/impl/MutableLogEventTest.java| 86 ++ .../log4j/test/appender/ListAppender.java | 9 +- .../resources/gcFreeMixedSyncAsyncLogging.xml | 71 pom.xml | 5 + src/changes/changes.xml | 3 + 39 files changed, 926 insertions(+), 308 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/98cc7d27/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/JacksonFactory.java --
[3/4] logging-log4j2 git commit: Fix appender name.
Fix appender name. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/51142337 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/51142337 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/51142337 Branch: refs/heads/master Commit: 51142337af823fd49dcfee17527cefd424e5fe6c Parents: 98cc7d2 Author: ggregoryAuthored: Sun Apr 17 15:46:45 2016 -0700 Committer: ggregory Committed: Sun Apr 17 15:46:45 2016 -0700 -- log4j-core/src/test/resources/JsonCompleteFileAppenderTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/51142337/log4j-core/src/test/resources/JsonCompleteFileAppenderTest.xml -- diff --git a/log4j-core/src/test/resources/JsonCompleteFileAppenderTest.xml b/log4j-core/src/test/resources/JsonCompleteFileAppenderTest.xml index 0f83ae5..7298437 100644 --- a/log4j-core/src/test/resources/JsonCompleteFileAppenderTest.xml +++ b/log4j-core/src/test/resources/JsonCompleteFileAppenderTest.xml @@ -1,14 +1,14 @@ - + - +
[4/4] logging-log4j2 git commit: [LOG4J2-1362] Create a YAML layout.
[LOG4J2-1362] Create a YAML layout. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/ffbd8c9b Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/ffbd8c9b Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/ffbd8c9b Branch: refs/heads/master Commit: ffbd8c9b2268815449b3b5321cdbf936395d34f1 Parents: 5114233 Author: ggregoryAuthored: Sun Apr 17 16:07:40 2016 -0700 Committer: ggregory Committed: Sun Apr 17 16:07:40 2016 -0700 -- .../logging/log4j/core/layout/YamlLayout.java | 677 ++- .../appender/JsonCompleteFileAppenderTest.java | 2 +- src/site/site.xml | 1 + src/site/xdoc/manual/layouts.xml.vm | 151 + 4 files changed, 807 insertions(+), 24 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ffbd8c9b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/YamlLayout.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/YamlLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/YamlLayout.java index 0426fea..b68b836 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/YamlLayout.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/YamlLayout.java @@ -32,27 +32,664 @@ import org.apache.logging.log4j.core.config.plugins.Plugin; import org.apache.logging.log4j.core.config.plugins.PluginAttribute; import org.apache.logging.log4j.core.config.plugins.PluginConfiguration; import org.apache.logging.log4j.core.config.plugins.PluginFactory; +import org.apache.logging.log4j.util.Strings; /** * Appends a series of YAML events as strings serialized as bytes. * - * Complete well-formed YAML vs. fragment YAML * - * If you configure {@code complete="true"}, the appender outputs a well-formed YAML document. By default, with - * {@code complete="false"}, you should include the output as an external file in a separate file to form a - * well-formed YAML document. - * - * - * A well-formed YAML event follows this pattern: + * A YAML log event follows this pattern: * * - * - * - * - * - * If {@code complete="false"}, the appender does not write the YAML open array character "[" at the start of the - * document, "]" and the end, nor comma "," between records. - * + * --- +timeMillis: 1 +thread: "MyThreadName" +level: "DEBUG" +loggerName: "a.B" +marker: + name: "Marker1" + parents: + - name: "ParentMarker1" +parents: +- name: "GrandMotherMarker" +- name: "GrandFatherMarker" + - name: "ParentMarker2" +message: "Msg" +thrown: + commonElementCount: 0 + localizedMessage: "testIOEx" + message: "testIOEx" + name: "java.io.IOException" + cause: +commonElementCount: 27 +localizedMessage: "testNPEx" +message: "testNPEx" +name: "java.lang.NullPointerException" +extendedStackTrace: +- class: "org.apache.logging.log4j.core.layout.LogEventFixtures" + method: "createLogEvent" + file: "LogEventFixtures.java" + line: 52 + exact: false + location: "test-classes/" + version: "?" + extendedStackTrace: + - class: "org.apache.logging.log4j.core.layout.LogEventFixtures" +method: "createLogEvent" +file: "LogEventFixtures.java" +line: 55 +exact: true +location: "test-classes/" +version: "?" + - class: "org.apache.logging.log4j.core.layout.YamlLayoutTest" +method: "testAllFeatures" +file: "YamlLayoutTest.java" +line: 109 +exact: true +location: "test-classes/" +version: "?" + - class: "org.apache.logging.log4j.core.layout.YamlLayoutTest" +method: "testLocationOnCompactOffEventEolOffMdcOn" +file: "YamlLayoutTest.java" +line: 280 +exact: true +location: "test-classes/" +version: "?" + - class: "sun.reflect.NativeMethodAccessorImpl" +method: "invoke0" +file: "NativeMethodAccessorImpl.java" +line: -2 +exact: false +location: "?" +version: "1.7.0_79" + - class: "sun.reflect.NativeMethodAccessorImpl" +method: "invoke" +file: "NativeMethodAccessorImpl.java" +line: 57 +exact: false +location: "?" +version: "1.7.0_79" + - class: "sun.reflect.DelegatingMethodAccessorImpl" +method: "invoke" +file: "DelegatingMethodAccessorImpl.java" +line: 43 +exact: false +location: "?" +version: "1.7.0_79" + - class: "java.lang.reflect.Method" +method: "invoke" +file: "Method.java" +line: 606 +exact: false +location: "?" +version: "1.7.0_79" + - class: "org.junit.runners.model.FrameworkMethod$1" +method: "runReflectiveCall" +file:
logging-log4j2 git commit: LOG4J2-1297 latency test javadoc
Repository: logging-log4j2 Updated Branches: refs/heads/master c5f5cc9f2 -> 3c37ca34d LOG4J2-1297 latency test javadoc Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/3c37ca34 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/3c37ca34 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/3c37ca34 Branch: refs/heads/master Commit: 3c37ca34db7ada0d7bb20de5a3cd1caf4f4eced7 Parents: c5f5cc9 Author: rpopmaAuthored: Sun Apr 17 22:42:54 2016 +0900 Committer: rpopma Committed: Sun Apr 17 22:42:54 2016 +0900 -- .../core/async/perftest/SimpleLatencyTest.java | 31 ++-- 1 file changed, 29 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3c37ca34/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimpleLatencyTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimpleLatencyTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimpleLatencyTest.java index f7459b6..1a306b1 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimpleLatencyTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/SimpleLatencyTest.java @@ -26,7 +26,34 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; /** - * + * Latency test. + * + * See https://groups.google.com/d/msg/mechanical-sympathy/0gaBXxFm4hE/O9QomwHIJAAJ;>https://groups.google.com/d/msg/mechanical-sympathy/0gaBXxFm4hE/O9QomwHIJAAJ: + * + * Gil Tene's rules of thumb for latency tests: + * + * DO measure max achievable throughput, but DON'T get focused on it as the main or single axis of measurement / + * comparison. + * DO measure response time / latency behaviors across a spectrum of attempted load levels (e.g. at attempted loads + * between 2% to 100%+ of max established thoughout). + * DO measure the response time / latency spectrum for each tested load (even for max throughout, for which response + * time should linearly grow with test length, or the test is wrong). HdrHistogram is one good way to capture this + * information. + * DO make sure you are measuring response time correctly and labeling it right. If you also measure and report + * service time, label it as such (don't call it "latency"). + * DO compare response time / latency spectrum at given loads. + * DO [repeatedly] sanity check and calibrate the benchmark setup to verify that it produces expected results for + * known forced scenarios. E.g. forced pauses of known size via ^Z or SIGSTOP/SIGCONT should produce expected response + * time percentile levels. Attempting to load at >100% than achieved throughput should result in response time / latency + * measurements that grow with benchmark run length, while service time (if measured) should remain fairly flat well + * past saturation. + * DON'T use or report standard deviation for latency. Ever. Except if you mean it as a joke. + * DON'T use average latency as a way to compare things with one another. [use median or 90%'ile instead, if what + * you want to compare is "common case" latencies]. Consider not reporting avg. at all. + * DON'T compare results of different setups or loads from short runs (< 20-30 minutes). + * DON'T include process warmup behavior (e.g. 1st minute and 1st 50K messages) in compared or reported results. + * + * */ public class SimpleLatencyTest { private static final String LATENCY_MSG = new String(new char[64]); @@ -61,7 +88,7 @@ public class SimpleLatencyTest { List histograms = new ArrayList<>(threadCount); -for (int i = 0 ; i < 30; i++) { +for (int i = 0; i < 30; i++) { final int ITERATIONS = 100 * 1000;// * 30; runLatencyTest(logger, ITERATIONS, interval, idleStrategy, histograms, nanoTimeCost, threadCount);
logging-log4j2 git commit: LOG4J2-1297 made some progress on latency test
Repository: logging-log4j2 Updated Branches: refs/heads/master 8ebed8fc0 -> c5f5cc9f2 LOG4J2-1297 made some progress on latency test Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/c5f5cc9f Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/c5f5cc9f Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/c5f5cc9f Branch: refs/heads/master Commit: c5f5cc9f2079235ac36c050bbc42bf3ac28edc28 Parents: 8ebed8f Author: rpopmaAuthored: Sun Apr 17 22:19:44 2016 +0900 Committer: rpopma Committed: Sun Apr 17 22:19:44 2016 +0900 -- .../log4j/core/async/perftest/IdleStrategy.java | 43 ++ .../core/async/perftest/NoOpIdleStrategy.java | 34 .../core/async/perftest/SimpleLatencyTest.java | 87 +--- 3 files changed, 133 insertions(+), 31 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c5f5cc9f/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/IdleStrategy.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/IdleStrategy.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/IdleStrategy.java new file mode 100644 index 000..77d9d74 --- /dev/null +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/IdleStrategy.java @@ -0,0 +1,43 @@ +package org.apache.logging.log4j.core.async.perftest; + +/** + * Idle strategy for use by threads when they do not have work to do. + * + * Note regarding implementor state + * + * Some implementations are known to be stateful, please note that you cannot safely assume implementations to be stateless. + * Where implementations are stateful it is recommended that implementation state is padded to avoid false sharing. + * + * Note regarding potential for TTSP(Time To Safe Point) issues + * + * If the caller spins in a 'counted' loop, and the implementation does not include a a safepoint poll this may cause a TTSP + * (Time To SafePoint) problem. If this is the case for your application you can solve it by preventing the idle method from + * being inlined by using a Hotspot compiler command as a JVM argument e.g: + * -XX:CompileCommand=dontinline,org.apache.logging.log4j.core.async.perftest.NoOpIdleStrategy::idle + * + * @see https://github.com/real-logic/Agrona/blob/master/src/main/java/org/agrona/concurrent/IdleStrategy.java;> + * https://github.com/real-logic/Agrona/blob/master/src/main/java/org/agrona/concurrent/IdleStrategy.java + */ +public interface IdleStrategy { +/** + * Perform current idle action (e.g. nothing/yield/sleep). To be used in conjunction with {@link IdleStrategy#reset()} + * to clear internal state when idle period is over (or before it begins). Callers are expected to follow this pattern: + * + * + * while (isRunning) { + * if (!hasWork()) { + * idleStrategy.reset(); + * while (!hasWork()) { + * if (!isRunning) { + * return; + * } + * idleStrategy.idle(); + * } + * } + * doWork(); + * } + * + * + */ +void idle(); +} http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c5f5cc9f/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/NoOpIdleStrategy.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/NoOpIdleStrategy.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/NoOpIdleStrategy.java new file mode 100644 index 000..867a9dd --- /dev/null +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/NoOpIdleStrategy.java @@ -0,0 +1,34 @@ +/* + * 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.core.async.perftest; + +/** + * Low-latency idle
[2/2] logging-log4j2 git commit: LOG4J2-1334 improved and added gc-free unit tests:
LOG4J2-1334 improved and added gc-free unit tests: - Move shared logic to new class GcFreeLoggingTestUtil - Renamed GcFreeLoggingTest to GcFreeAsynchronousLoggingTest - Added GcFreeSynchronousLoggingTest - Added GcFreeMixedSyncAsyncLoggingTest with config gcFreeMixedSyncAsyncLogging.xml Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/8ebed8fc Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/8ebed8fc Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/8ebed8fc Branch: refs/heads/master Commit: 8ebed8fc0e87d0bc1a95b1a9851702ac336c9374 Parents: 3706664 Author: rpopmaAuthored: Sun Apr 17 22:17:01 2016 +0900 Committer: rpopma Committed: Sun Apr 17 22:17:01 2016 +0900 -- .../core/GcFreeAsynchronousLoggingTest.java | 41 + .../logging/log4j/core/GcFreeLoggingTest.java | 173 --- .../log4j/core/GcFreeLoggingTestUtil.java | 169 ++ .../core/GcFreeMixedSyncAyncLoggingTest.java| 58 +++ .../core/GcFreeSynchronousLoggingTest.java | 58 +++ .../resources/gcFreeMixedSyncAsyncLogging.xml | 71 6 files changed, 397 insertions(+), 173 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8ebed8fc/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeAsynchronousLoggingTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeAsynchronousLoggingTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeAsynchronousLoggingTest.java new file mode 100644 index 000..a74a35b --- /dev/null +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeAsynchronousLoggingTest.java @@ -0,0 +1,41 @@ +/* + * 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.core; + +import org.apache.logging.log4j.core.async.AsyncLoggerContextSelector; +import org.junit.Test; + +/** + * Verifies steady state logging is GC-free. + * + * @see https://github.com/google/allocation-instrumenter;>https://github.com/google/allocation-instrumenter + */ +public class GcFreeAsynchronousLoggingTest { + +@Test +public void testNoAllocationDuringSteadyStateLogging() throws Throwable { +GcFreeLoggingTestUtil.runTest(getClass()); +} + +/** + * This code runs in a separate process, instrumented with the Google Allocation Instrumenter. + */ +public static void main(String[] args) throws Exception { +System.setProperty("Log4jContextSelector", AsyncLoggerContextSelector.class.getName()); +GcFreeLoggingTestUtil.executeLogging("gcFreeLogging.xml", GcFreeAsynchronousLoggingTest.class); +} +} http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8ebed8fc/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTest.java deleted file mode 100644 index c66bae3..000 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTest.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * 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
[1/2] logging-log4j2 git commit: LOG4J2-1334 MutableLogEvent unit test initial version
Repository: logging-log4j2 Updated Branches: refs/heads/master aa4ce1ef1 -> 8ebed8fc0 LOG4J2-1334 MutableLogEvent unit test initial version Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/37066643 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/37066643 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/37066643 Branch: refs/heads/master Commit: 37066643e99ae35d9689f4ad1ed6d9296dfb9f3a Parents: aa4ce1e Author: rpopmaAuthored: Sun Apr 17 20:43:44 2016 +0900 Committer: rpopma Committed: Sun Apr 17 20:43:44 2016 +0900 -- .../log4j/core/impl/MutableLogEvent.java| 1 + .../log4j/core/impl/MutableLogEventTest.java| 86 2 files changed, 87 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/37066643/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java index 9ca179b..9edb6f2 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java @@ -66,6 +66,7 @@ public class MutableLogEvent implements LogEvent, ReusableMessage { this.threadName = event.getThreadName(); this.threadPriority = event.getThreadPriority(); this.endOfBatch = event.isEndOfBatch(); +this.includeLocation = event.isIncludeLocation(); this.nanoTime = event.getNanoTime(); setMessage(event.getMessage()); } http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/37066643/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/MutableLogEventTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/MutableLogEventTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/MutableLogEventTest.java new file mode 100644 index 000..23a49f4 --- /dev/null +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/MutableLogEventTest.java @@ -0,0 +1,86 @@ +package org.apache.logging.log4j.core.impl;/* + * 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. + */ + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; +import org.apache.logging.log4j.ThreadContext; +import org.apache.logging.log4j.message.Message; +import org.apache.logging.log4j.message.SimpleMessage; +import org.apache.logging.log4j.spi.MutableThreadContextStack; +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Tests the MutableLogEvent class. + */ +public class MutableLogEventTest { +private static final Map CONTEXTMAP = createContextMap(); +private static final ThreadContext.ContextStack STACK = new MutableThreadContextStack(Arrays.asList("abc", "xyz")); + +private static Map createContextMap() { +Map result = new HashMap<>(); +result.put("a", "1"); +result.put("b", "2"); +return result; +} + +@Test +public void testInitFromCopiesAllFields() { +//private ThrowableProxy thrownProxy; +Log4jLogEvent source = Log4jLogEvent.newBuilder() // +.setContextMap(CONTEXTMAP) // +.setContextStack(STACK) // +.setEndOfBatch(true) // +.setIncludeLocation(true) // +.setLevel(Level.FATAL) // +.setLoggerFqcn("a.b.c.d.e") // +.setLoggerName("my name is Logger") // +.setMarker(MarkerManager.getMarker("on your marks")) // +
logging-log4j2 git commit: LOG4J2-1334 javadoc
Repository: logging-log4j2 Updated Branches: refs/heads/master 554086869 -> aa4ce1ef1 LOG4J2-1334 javadoc Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/aa4ce1ef Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/aa4ce1ef Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/aa4ce1ef Branch: refs/heads/master Commit: aa4ce1ef171b733f6866ebffa7782eadbe16a370 Parents: 5540868 Author: rpopmaAuthored: Sun Apr 17 15:49:51 2016 +0900 Committer: rpopma Committed: Sun Apr 17 15:49:51 2016 +0900 -- .../java/org/apache/logging/log4j/core/impl/MutableLogEvent.java | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/aa4ce1ef/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java index e86c553..9ca179b 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java @@ -70,6 +70,9 @@ public class MutableLogEvent implements LogEvent, ReusableMessage { setMessage(event.getMessage()); } +/** + * Clears all references this event has to other objects. + */ public void clear() { loggerFqcn = null; marker = null;
logging-log4j2 git commit: LOG4J2-1274 moved ByteBuffer size from OutputStreamManager to Constants, improved Constants docs
Repository: logging-log4j2 Updated Branches: refs/heads/master 7a9d18c3e -> 554086869 LOG4J2-1274 moved ByteBuffer size from OutputStreamManager to Constants, improved Constants docs Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/55408686 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/55408686 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/55408686 Branch: refs/heads/master Commit: 554086869fe0a49fb1edd9dae4f257c393baab9a Parents: 7a9d18c Author: rpopmaAuthored: Sun Apr 17 15:27:10 2016 +0900 Committer: rpopma Committed: Sun Apr 17 15:27:10 2016 +0900 -- .../apache/logging/log4j/core/appender/FileManager.java | 3 ++- .../logging/log4j/core/appender/OutputStreamManager.java | 7 +++ .../log4j/core/appender/rolling/RollingFileManager.java | 4 ++-- .../logging/log4j/core/layout/ByteBufferDestination.java | 8 +--- .../org/apache/logging/log4j/core/util/Constants.java| 11 +++ 5 files changed, 23 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/55408686/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java index 43372b6..060f2db 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java @@ -29,6 +29,7 @@ import java.util.HashMap; import java.util.Map; import org.apache.logging.log4j.core.Layout; +import org.apache.logging.log4j.core.util.Constants; /** @@ -213,7 +214,7 @@ public class FileManager extends OutputStreamManager { OutputStream os; try { os = new FileOutputStream(name, data.append); -final int actualSize = data.bufferedIO ? data.bufferSize : DEFAULT_BUFFER_SIZE; +final int actualSize = data.bufferedIO ? data.bufferSize : Constants.ENCODER_BYTE_BUFFER_SIZE; final ByteBuffer buffer = ByteBuffer.wrap(new byte[actualSize]); return new FileManager(name, os, data.append, data.locking, data.advertiseURI, data.layout, writeHeader, buffer); http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/55408686/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java index b22f083..20ef401 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java @@ -23,21 +23,20 @@ import java.util.Objects; import org.apache.logging.log4j.core.Layout; import org.apache.logging.log4j.core.layout.ByteBufferDestination; +import org.apache.logging.log4j.core.util.Constants; /** * Manages an OutputStream so that it can be shared by multiple Appenders and will * allow appenders to reconfigure without requiring a new stream. */ public class OutputStreamManager extends AbstractManager implements ByteBufferDestination { -protected static final int DEFAULT_BUFFER_SIZE = 8 * 1024; - -private volatile OutputStream os; protected final Layout layout; protected ByteBuffer byteBuffer; +private volatile OutputStream os; protected OutputStreamManager(final OutputStream os, final String streamName, final Layout layout, final boolean writeHeader) { -this(os, streamName, layout, writeHeader, ByteBuffer.wrap(new byte[DEFAULT_BUFFER_SIZE])); +this(os, streamName, layout, writeHeader, ByteBuffer.wrap(new byte[Constants.ENCODER_BYTE_BUFFER_SIZE])); } /** http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/55408686/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java index d0b0735..9c573eb 100644 ---