logging-log4j2 git commit: Fix KafkaAppender tests
Repository: logging-log4j2 Updated Branches: refs/heads/master 8f53bd9cf -> e7f3c8c4f Fix KafkaAppender 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/e7f3c8c4 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e7f3c8c4 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e7f3c8c4 Branch: refs/heads/master Commit: e7f3c8c4f48538efbf3729334fa6253275d1cc64 Parents: 8f53bd9 Author: Mikael StåldalAuthored: Thu Jan 25 22:04:12 2018 +0100 Committer: Mikael Ståldal Committed: Thu Jan 25 22:04:12 2018 +0100 -- .../kafka/KafkaAppenderCloseTimeoutTest.java| 78 .../appender/mom/kafka/KafkaAppenderTest.java | 10 --- .../resources/KafkaAppenderCloseTimeoutTest.xml | 31 3 files changed, 109 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e7f3c8c4/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderCloseTimeoutTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderCloseTimeoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderCloseTimeoutTest.java new file mode 100644 index 000..a8d3566 --- /dev/null +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderCloseTimeoutTest.java @@ -0,0 +1,78 @@ +/* + * 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.mom.kafka; + +import java.util.Properties; +import java.util.concurrent.TimeUnit; + +import org.apache.kafka.clients.producer.MockProducer; +import org.apache.kafka.clients.producer.Producer; +import org.apache.logging.log4j.categories.Appenders; +import org.apache.logging.log4j.core.Appender; +import org.apache.logging.log4j.junit.LoggerContextRule; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +@Category(Appenders.Kafka.class) +public class KafkaAppenderCloseTimeoutTest { + +private static final MockProducer kafka = new MockProducer (true, null, null) { +@Override +public void close() { +try { +Thread.sleep(3000); +} catch (InterruptedException ignore) { +} +} + +@Override +public void close(long timeout, TimeUnit timeUnit) { +try { +Thread.sleep(timeUnit.toMillis(timeout)); +} catch (InterruptedException ignore) { +} +} +}; + +@BeforeClass +public static void setUpClass() throws Exception { +KafkaManager.producerFactory = new KafkaProducerFactory() { +@Override +public Producer newKafkaProducer(final Properties config) { +return kafka; +} +}; +} + +@Rule +public LoggerContextRule ctx = new LoggerContextRule("KafkaAppenderCloseTimeoutTest.xml"); + +@Before +public void setUp() throws Exception { +kafka.clear(); +} + +@Test(timeout = 2000) +public void testClose() throws Exception { +final Appender appender = ctx.getRequiredAppender("KafkaAppender"); +appender.stop(); +} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e7f3c8c4/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaAppenderTest.java index 0c718b3..613bd74 100644 ---
[5/5] logging-log4j2 git commit: LOG4J2-2190 add description of the 'objectMessageAsJsonObject' parameter
LOG4J2-2190 add description of the 'objectMessageAsJsonObject' parameter Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/bda0775a Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/bda0775a Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/bda0775a Branch: refs/heads/master Commit: bda0775a74e2b0138cde7538222d40e552d3d79a Parents: 618b28f Author: Franz WongAuthored: Fri Jan 19 09:48:26 2018 +0900 Committer: Mikael Ståldal Committed: Sat Jan 20 16:18:00 2018 +0100 -- src/site/xdoc/manual/layouts.xml.vm | 5 + 1 file changed, 5 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bda0775a/src/site/xdoc/manual/layouts.xml.vm -- diff --git a/src/site/xdoc/manual/layouts.xml.vm b/src/site/xdoc/manual/layouts.xml.vm index 070f5fa..c406aaa 100644 --- a/src/site/xdoc/manual/layouts.xml.vm +++ b/src/site/xdoc/manual/layouts.xml.vm @@ -466,6 +466,11 @@ logger.debug("one={}, two={}, three={}", 1, 2, 3); boolean Whether to include NULL byte as delimiter after each event (optional, default to false). + + objectMessageAsJsonObject + boolean + If true, ObjectMessage is serialized as JSON object to the "message" field of the output log. Defaults to false. + JsonLayout Parameters
[1/5] logging-log4j2 git commit: LOG4J2-2190 support writing JSON object in message field
Repository: logging-log4j2 Updated Branches: refs/heads/master b8a0d9fc1 -> bda0775a7 LOG4J2-2190 support writing JSON object in message field Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/df6a3a33 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/df6a3a33 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/df6a3a33 Branch: refs/heads/master Commit: df6a3a33ae4975d337cd854d87605bf0db8453ac Parents: d7d5cfd Author: Franz WongAuthored: Tue Jan 16 14:56:06 2018 +0900 Committer: Mikael Ståldal Committed: Thu Jan 18 21:52:24 2018 +0100 -- .../log4j/core/jackson/Initializers.java| 8 +++- .../log4j/core/jackson/Log4jJsonModule.java | 6 ++- .../core/jackson/Log4jJsonObjectMapper.java | 6 +-- .../log4j/core/jackson/Log4jXmlModule.java | 2 +- .../log4j/core/jackson/Log4jYamlModule.java | 2 +- .../log4j/core/jackson/LogEventJsonMixIn.java | 1 - .../core/jackson/ObjectMessageSerializer.java | 47 +++ .../log4j/core/layout/JacksonFactory.java | 7 ++- .../logging/log4j/core/layout/JsonLayout.java | 24 +++--- .../log4j/core/jackson/LevelMixInJsonTest.java | 2 +- .../jackson/StackTraceElementMixInTest.java | 2 +- .../log4j/core/layout/JsonLayoutTest.java | 49 +++- 12 files changed, 135 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/df6a3a33/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/Initializers.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/Initializers.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/Initializers.java index b7387e5..65c8438 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/Initializers.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/Initializers.java @@ -22,6 +22,8 @@ import org.apache.logging.log4j.ThreadContext.ContextStack; import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.impl.ExtendedStackTraceElement; import org.apache.logging.log4j.core.impl.ThrowableProxy; +import org.apache.logging.log4j.message.Message; +import org.apache.logging.log4j.message.ObjectMessage; import com.fasterxml.jackson.databind.Module.SetupContext; import com.fasterxml.jackson.databind.module.SimpleModule; @@ -78,11 +80,15 @@ class Initializers { * Used to set up {@link SimpleModule} from different {@link SimpleModule} subclasses. */ static class SimpleModuleInitializer { -void initialize(final SimpleModule simpleModule) { +void initialize(final SimpleModule simpleModule, final boolean objectMessageAsJsonObject) { // Workaround because mix-ins do not work for classes that already have a built-in deserializer. // See Jackson issue 429. simpleModule.addDeserializer(StackTraceElement.class, new Log4jStackTraceElementDeserializer()); simpleModule.addDeserializer(ContextStack.class, new MutableThreadContextStackDeserializer()); +if (objectMessageAsJsonObject) { + simpleModule.addSerializer(ObjectMessage.class, new ObjectMessageSerializer()); +} +simpleModule.addSerializer(Message.class, new MessageSerializer()); } } http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/df6a3a33/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/Log4jJsonModule.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/Log4jJsonModule.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/Log4jJsonModule.java index e6aa49e..ceb53b4 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/Log4jJsonModule.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/Log4jJsonModule.java @@ -34,16 +34,18 @@ class Log4jJsonModule extends SimpleModule { private final boolean encodeThreadContextAsList; private final boolean includeStacktrace; private final boolean stacktraceAsString; +private final boolean objectMessageAsJsonObject; -Log4jJsonModule(final boolean encodeThreadContextAsList, final boolean includeStacktrace, final boolean stacktraceAsString) { +Log4jJsonModule(final boolean encodeThreadContextAsList, final boolean includeStacktrace, final boolean stacktraceAsString, final boolean objectMessageAsJsonObject) { super(Log4jJsonModule.class.getName(), new Version(2, 0, 0, null, null, null));
[4/5] logging-log4j2 git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/logging-log4j2
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/logging-log4j2 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/618b28f9 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/618b28f9 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/618b28f9 Branch: refs/heads/master Commit: 618b28f9e2457fcd4c10817903265cf5c46f04c8 Parents: bfac5f8 b8a0d9f Author: Mikael StåldalAuthored: Sat Jan 20 16:17:38 2018 +0100 Committer: Mikael Ståldal Committed: Sat Jan 20 16:17:38 2018 +0100 -- log4j-core/pom.xml | 1 + .../db/jdbc/AbstractConnectionSource.java | 26 +++ .../AbstractDriverManagerConnectionSource.java | 219 +++ .../core/appender/db/jdbc/ConnectionSource.java | 4 +- .../db/jdbc/DataSourceConnectionSource.java | 2 +- .../db/jdbc/DriverManagerConnectionSource.java | 125 +-- .../db/jdbc/FactoryMethodConnectionSource.java | 2 +- .../appender/db/jdbc/JdbcDatabaseManager.java | 3 + .../jdbc/JdbcAppenderHsqldbDataSourceTest.java | 2 +- .../JdbcAppenderHsqldbFactoryMethodTest.java| 2 +- .../core/appender/db/jdbc/JdbcH2TestHelper.java | 2 +- log4j-jdbc-dbcp2/pom.xml| 170 ++ .../db/jdbc/PoolingDriverConnectionSource.java | 165 ++ log4j-jdbc-dbcp2/src/site/manual/index.md | 35 +++ log4j-jdbc-dbcp2/src/site/site.xml | 52 + .../jdbc/PoolingDriverConnectionSourceTest.java | 96 log4j-mongodb/pom.xml | 6 +- .../log4j-samples-flume-embedded/pom.xml| 2 +- pom.xml | 11 +- src/changes/changes.xml | 9 + src/site/xdoc/manual/appenders.xml | 33 ++- 21 files changed, 839 insertions(+), 128 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/618b28f9/src/changes/changes.xml --
[3/5] logging-log4j2 git commit: LOG4J2-2190 Update changes.xml
LOG4J2-2190 Update changes.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/bfac5f80 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/bfac5f80 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/bfac5f80 Branch: refs/heads/master Commit: bfac5f807877b4bd5c24d917e53cbdc7adf206ab Parents: 5c0838b Author: Mikael StåldalAuthored: Thu Jan 18 22:15:42 2018 +0100 Committer: Mikael Ståldal Committed: Thu Jan 18 22:15:42 2018 +0100 -- src/changes/changes.xml | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/bfac5f80/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 8cb729a..7ed74e4 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -31,6 +31,9 @@ - "remove" - Removed --> + +Output Json object for ObjectMessage in JsonLayout. + Made log4j-core a multi-release ("multi-version") jar, added log4j-core-java9 module.
[2/5] logging-log4j2 git commit: Closes #141
Closes #141 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/5c0838b2 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/5c0838b2 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/5c0838b2 Branch: refs/heads/master Commit: 5c0838b21288f774d09e75dc2fbc57c7c73ea64b Parents: df6a3a3 Author: Mikael StåldalAuthored: Thu Jan 18 22:12:02 2018 +0100 Committer: Mikael Ståldal Committed: Thu Jan 18 22:12:02 2018 +0100 -- --
logging-log4j-plugins git commit: Move classes to correct place
Repository: logging-log4j-plugins Updated Branches: refs/heads/avro-layout 9ed7256c1 -> 727411b62 Move classes to correct place Project: http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/commit/727411b6 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/tree/727411b6 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/diff/727411b6 Branch: refs/heads/avro-layout Commit: 727411b6218367f537b5950ebc12813d3b4fb85e Parents: 9ed7256 Author: Mikael StåldalAuthored: Tue Jan 16 22:22:02 2018 +0100 Committer: Mikael Ståldal Committed: Tue Jan 16 22:22:02 2018 +0100 -- .../apache/logging/log4j/avro/AvroLayout.java | 198 +++ .../logging/log4j/avro/AvroLogEventParser.java | 48 + .../apache/logging/log4j/avro/package-info.java | 1 - .../apache/logging/log4j/avro/AvroAppender.java | 5 - .../apache/logging/log4j/avro/AvroLayout.java | 198 --- .../logging/log4j/avro/AvroLogEventParser.java | 48 - 6 files changed, 246 insertions(+), 252 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/blob/727411b6/log4j-avro/src/main/java/org/apache/logging/log4j/avro/AvroLayout.java -- diff --git a/log4j-avro/src/main/java/org/apache/logging/log4j/avro/AvroLayout.java b/log4j-avro/src/main/java/org/apache/logging/log4j/avro/AvroLayout.java new file mode 100644 index 000..ec511e7 --- /dev/null +++ b/log4j-avro/src/main/java/org/apache/logging/log4j/avro/AvroLayout.java @@ -0,0 +1,198 @@ +/* + * 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.avro; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.logging.log4j.ThreadContext; +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.PluginBuilderAttribute; +import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory; +import org.apache.logging.log4j.core.layout.AbstractLayout; +import org.apache.logging.log4j.core.layout.ByteBufferDestination; +import org.apache.logging.log4j.util.ReadOnlyStringMap; +import org.apache.logging.log4j.util.TriConsumer; + +/** + * Lays out events in Apache Avro binary format. + * + * @see https://avro.apache.org/docs/current/spec.html;>Avro specification + */ +@Plugin(name = "AvroLayout", category = Node.CATEGORY, elementType = Layout.ELEMENT_TYPE, printObject = true) +public final class AvroLayout extends AbstractLayout { + +private final boolean locationInfo; +private final boolean includeStacktrace; + +public static class Builder> extends AbstractLayout.Builder +implements org.apache.logging.log4j.core.util.Builder { + +@PluginBuilderAttribute +private boolean locationInfo; + +@PluginBuilderAttribute +private boolean includeStacktrace = true; + +@Override +public AvroLayout build() { +return new AvroLayout(getConfiguration(), includeStacktrace, locationInfo); +} + +public boolean isLocationInfo() { +return locationInfo; +} + +public boolean isIncludeStacktrace() { +return includeStacktrace; +} + +/** + * Whether to include stacktrace of logged Throwables (optional, default to true). + * + * If set to false, the Throwable will be omitted. + * + * @return this builder + */ +public B setLocationInfo(final boolean locationInfo) { +this.locationInfo = locationInfo; +
[1/2] logging-log4j-plugins git commit: Add root POM and .gitignore
Repository: logging-log4j-plugins Updated Branches: refs/heads/avro-layout [created] 9ed7256c1 Add root POM and .gitignore Project: http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/commit/65cf6432 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/tree/65cf6432 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/diff/65cf6432 Branch: refs/heads/avro-layout Commit: 65cf64322dc16aa393dbc52e5bf758405d9adadb Parents: 8fe7ba6 Author: Mikael Ståldal <mikaelstal...@spotify.com> Authored: Tue Jan 16 11:30:21 2018 +0100 Committer: Mikael Ståldal <mikaelstal...@spotify.com> Committed: Tue Jan 16 11:30:21 2018 +0100 -- .gitignore | 27 ++ pom.xml| 966 2 files changed, 993 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/blob/65cf6432/.gitignore -- diff --git a/.gitignore b/.gitignore new file mode 100644 index 000..627e878 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +# 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. + +.project +.idea +**/*.iml +**/target +target/ +.settings +.classpath +.cache-main +.cache-tests +velocity.log +felix-cache/ +bin/ http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/blob/65cf6432/pom.xml -- diff --git a/pom.xml b/pom.xml new file mode 100644 index 000..f70b320 --- /dev/null +++ b/pom.xml @@ -0,0 +1,966 @@ + + +http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd;> + 4.0.0 + org.apache.logging.log4j + log4j-plugins + pom + Apache Log4j 2 Plugins + 2.10.1-SNAPSHOT + +org.apache.logging +logging-parent +1 + + Apache Log4j 2 Plugins + https://logging.apache.org/log4j/2.x/ + +JIRA +https://issues.apache.org/jira/browse/LOG4J2 + + 1999 + + + rgoers + Ralph Goers + rgo...@apache.org + Nextiva + +PMC Chair + + America/Phoenix + + + ggregory + Gary Gregory + ggreg...@apache.org + Rocket Software + +PMC Member + + America/Denver + + + sdeboy + Scott Deboy + sde...@apache.org + +PMC Member + + America/Los_Angeles + + + rpopma + Remko Popma + rpo...@apache.org + +PMC Member + + Asia/Tokyo + +http://people.apache.org/~rpopma/img/profilepic.jpg + + + + nickwilliams + Nick Williams + nickwilli...@apache.org + +PMC Member + + America/Chicago + + + mattsicker + Matt Sicker + mattsic...@apache.org + SPR Consulting + +PMC Member + + America/Chicago + + + bbrouwer + Bruce Brouwer + bruce.brou...@gmail.com + +Committer + + America/Detroit + + + mikes + Mikael Ståldal + mi...@apache.org + Spotify + +PMC Member + + Europe/Stockholm + + + + + +Murad Ersoy +murader...@gmail.com +https://www.behance.net/muradersoy + + Illustrator and Designer + created the new Log4j 2 logo. + +Europe/Istanbul + + https://mir-s3-cdn-cf.behance.net/user/138/403dcf1521581.54d67f8fb01f7.jpg + + + + + + log4j-user + log4j-user-subscr...@logging.apache.org + log4j-user-unsubscr...@logging.apache.org + log4j-u...@logging.apache.org + https://lists.apache.org/list.html?log4j-u...@logging.apache.org + + http://mail-archives.apache.org/mod_mbox/logging-log4j-user/ +http://marc.info
[2/2] logging-log4j-plugins git commit: Avro W.I.P.
Avro W.I.P. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/commit/9ed7256c Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/tree/9ed7256c Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/diff/9ed7256c Branch: refs/heads/avro-layout Commit: 9ed7256c1e13f5caa063ac9fc8bf686435e150af Parents: 65cf643 Author: Mikael StåldalAuthored: Tue Jan 16 17:57:11 2018 +0100 Committer: Mikael Ståldal Committed: Tue Jan 16 17:57:11 2018 +0100 -- log4j-avro/pom.xml | 192 ++ log4j-avro/src/main/avro/LogEvent.avpr | 253 +++ .../apache/logging/log4j/avro/package-info.java | 24 ++ log4j-avro/src/site/markdown/index.md.vm| 24 ++ log4j-avro/src/site/site.xml| 52 .../apache/logging/log4j/avro/AvroAppender.java | 5 + .../apache/logging/log4j/avro/AvroLayout.java | 198 +++ .../logging/log4j/avro/AvroLogEventParser.java | 48 .../src/test/resources/AvroLayoutTest.xml | 28 ++ pom.xml | 12 + 10 files changed, 836 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/blob/9ed7256c/log4j-avro/pom.xml -- diff --git a/log4j-avro/pom.xml b/log4j-avro/pom.xml new file mode 100644 index 000..c5a591a --- /dev/null +++ b/log4j-avro/pom.xml @@ -0,0 +1,192 @@ + + + +http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> + +org.apache.logging.log4j +log4j-plugins +2.10.1-SNAPSHOT + + 4.0.0 + + log4j-avro + Apache Log4j Avro + +Avro layout for Log4j. + + +${basedir}/.. +Avro Documentation +/log4j-avro +org.apache.logging.log4j.avro + + + + + org.apache.logging.log4j + log4j-core + + + org.apache.avro + avro + + + + junit + junit + test + + + org.mockito + mockito-core + test + + + org.apache.logging.log4j + log4j-api + test-jar + + + org.apache.logging.log4j + log4j-core + test-jar + + + + + + +org.apache.felix +maven-bundle-plugin + + +org.apache.logging.log4j.core +* + + + + +org.apache.avro +avro-maven-plugin + + +generate-sources + + schema + protocol + + + + + + + + + +org.apache.maven.plugins +maven-changes-plugin +${changes.plugin.version} + + + + changes-report + + + + + %URL%/show_bug.cgi?id=%ISSUE% + true + + + +org.apache.maven.plugins +maven-checkstyle-plugin +${checkstyle.plugin.version} + + + ${log4jParentDir}/checkstyle.xml + ${log4jParentDir}/checkstyle-suppressions.xml + false + basedir=${basedir} + licensedir=${log4jParentDir}/checkstyle-header.txt + + + +org.apache.maven.plugins +maven-javadoc-plugin +${javadoc.plugin.version} + + + + false + true + + + +non-aggregate + + javadoc + + + + + +org.codehaus.mojo +findbugs-maven-plugin +${findbugs.plugin.version} + + true + -Duser.language=en + Normal + Default + ${log4jParentDir}/findbugs-exclude-filter.xml + + + +org.apache.maven.plugins +maven-jxr-plugin +${jxr.plugin.version} + + +non-aggregate + + jxr + + + +aggregate + + aggregate + + + + + +org.apache.maven.plugins +maven-pmd-plugin +${pmd.plugin.version} + + ${maven.compiler.target} + + + + + http://git-wip-us.apache.org/repos/asf/logging-log4j-plugins/blob/9ed7256c/log4j-avro/src/main/avro/LogEvent.avpr -- diff --git
logging-log4j2 git commit: Fix messages documentation
Repository: logging-log4j2 Updated Branches: refs/heads/master 672832929 -> 5a438a988 Fix messages documentation Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/5a438a98 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/5a438a98 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/5a438a98 Branch: refs/heads/master Commit: 5a438a988953d9654ac4ae6f49735cbce6692c94 Parents: 6728329 Author: Mikael StåldalAuthored: Thu Jan 11 22:11:08 2018 +0100 Committer: Mikael Ståldal Committed: Thu Jan 11 22:11:08 2018 +0100 -- src/site/xdoc/manual/messages.xml | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5a438a98/src/site/xdoc/manual/messages.xml -- diff --git a/src/site/xdoc/manual/messages.xml b/src/site/xdoc/manual/messages.xml index fccd538..c243026 100644 --- a/src/site/xdoc/manual/messages.xml +++ b/src/site/xdoc/manual/messages.xml @@ -200,8 +200,10 @@ public class MyApp { A MapMessage contains a Map of String keys and values. MapMessage implements - FormattedMessage and accepts a format specifier of "XML", in which case the Map will be - formatted as XML. Otherwise, the Map will be formatted as "key1=value1 key2=value2 ...". + FormattedMessage and accepts format specifiers of "XML", "JSON" or "JAVA", in which case the Map + will be formatted as XML, JSON or as documented by + https://docs.oracle.com/javase/7/docs/api/java/util/AbstractMap.html#toString()">java.util.AbstractMap.toString(). + Otherwise, the Map will be formatted as "key1=value1 key2=value2 ...". Some Appenders make special use of MapMessage objects: @@ -224,7 +226,7 @@ public class MyApp { MessageFormatMessage - handles messages that use a http://docs.oracle.com/javase/6/docs/api/java/text/MessageFormat.html;>conversion format. + handles messages that use a https://docs.oracle.com/javase/7/docs/api/java/text/MessageFormat.html;>conversion format. While this Message has more flexibility than ParameterizedMessage, it is also about two times slower. MultiformatMessage @@ -256,7 +258,7 @@ public class MyApp { In garbage-free mode, this message is used to pass logged Objects to the Layout and Appenders. Functionally equivalent to ObjectMessage. - ReusableObjectMessage + ReusableParameterizedMessage In garbage-free mode, this message is used to handle messages that contain "{}" in the format to @@ -278,8 +280,8 @@ public class MyApp { StringFormattedMessage - handles messages that use a http://docs.oracle.com/javase/6/docs/api/java/util/Formatter.html#syntax;>conversion format - that is compliant with http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#format(java.lang.String, java.lang.Object...)">java.lang.String.format(). + handles messages that use a https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax;>conversion format + that is compliant with https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#format(java.lang.String, java.lang.Object...)">java.lang.String.format(). While this Message has more flexibility than ParameterizedMessage, it is also 5 to 10 times slower. StructuredDataMessage @@ -292,8 +294,8 @@ public class MyApp { ThreadDumpMessage - A ThreadDumpMessage, if logged, will generate stack traces for all threads. If running on Java 6+ the - stack traces will include any locks that are held. + A ThreadDumpMessage, if logged, will generate stack traces for all threads. + The stack traces will include any locks that are held. TimestampMessage
logging-log4j2 git commit: Fix configuration documentation
Repository: logging-log4j2 Updated Branches: refs/heads/master f40822099 -> e19e96305 Fix configuration documentation Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/e19e9630 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e19e9630 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e19e9630 Branch: refs/heads/master Commit: e19e963057cfeeaf41e6bb0482652403a43eab47 Parents: f408220 Author: Mikael StåldalAuthored: Wed Jan 10 19:57:12 2018 +0100 Committer: Mikael Ståldal Committed: Wed Jan 10 19:57:12 2018 +0100 -- src/site/xdoc/manual/configuration.xml.vm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e19e9630/src/site/xdoc/manual/configuration.xml.vm -- diff --git a/src/site/xdoc/manual/configuration.xml.vm b/src/site/xdoc/manual/configuration.xml.vm index 0890b39..02b3467 100644 --- a/src/site/xdoc/manual/configuration.xml.vm +++ b/src/site/xdoc/manual/configuration.xml.vm @@ -1639,8 +1639,7 @@ public class AwesomeTest { log4j.configurationFile - Path to an XML or JSON Log4j 2 configuration file. May also contain a comma separated list of configuration - file names. + Path to an Log4j 2 configuration file. May also contain a comma separated list of configuration file names.
logging-log4j2 git commit: LOG4J2-1944 improve error message when no configuration file is found
Repository: logging-log4j2 Updated Branches: refs/heads/master 1341bb669 -> f40822099 LOG4J2-1944 improve error message when no configuration file is found Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f4082209 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f4082209 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f4082209 Branch: refs/heads/master Commit: f408220999e079f8f3994684e84953987be68d6c Parents: 1341bb6 Author: Mikael StåldalAuthored: Tue Jan 9 17:37:56 2018 +0100 Committer: Mikael Ståldal Committed: Tue Jan 9 17:37:56 2018 +0100 -- .../apache/logging/log4j/core/config/ConfigurationFactory.java| 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f4082209/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java index 98ac069..7e6dfb2 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java @@ -390,7 +390,8 @@ public abstract class ConfigurationFactory extends ConfigurationBuilderFactory { return config; } LOGGER.error("No Log4j 2 configuration file found. " + -"Using default configuration: logging only errors to the console. " + +"Using default configuration (logging only errors to the console), " + +"or user programmatically provided configurations. " + "Set system property 'log4j2.debug' " + "to show Log4j 2 internal initialization logging. " + "See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2");
[logging-log4j2] Git Push Summary
Repository: logging-log4j2 Updated Branches: refs/heads/LOG4J2-2177-IndexedStringMap-test [deleted] f4eee5c6f
logging-log4j2 git commit: LOG4J2-2177 do not return IndexedStringMap in ContextDataFactory
Repository: logging-log4j2 Updated Branches: refs/heads/LOG4J2-2177-IndexedStringMap-test [created] f4eee5c6f LOG4J2-2177 do not return IndexedStringMap in ContextDataFactory Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f4eee5c6 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f4eee5c6 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f4eee5c6 Branch: refs/heads/LOG4J2-2177-IndexedStringMap-test Commit: f4eee5c6f4f26b49811b359ff76e4387c6de0b17 Parents: 7fcbb03 Author: Mikael StåldalAuthored: Mon Jan 8 23:29:14 2018 +0100 Committer: Mikael Ståldal Committed: Mon Jan 8 23:29:14 2018 +0100 -- .../log4j/layout/Log4j1XmlLayoutTest.java | 4 +- .../pattern/Log4j1MdcPatternConverterTest.java | 12 +++--- .../log4j/core/impl/ContextDataFactory.java | 43 ++-- .../log4j/core/impl/Log4jLogEventTest.java | 6 +-- .../log4j/core/layout/LogEventFixtures.java | 4 +- .../log4j/core/pattern/PatternParserTest.java | 6 +-- 6 files changed, 37 insertions(+), 38 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f4eee5c6/log4j-1.2-api/src/test/java/org/apache/log4j/layout/Log4j1XmlLayoutTest.java -- diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/layout/Log4j1XmlLayoutTest.java b/log4j-1.2-api/src/test/java/org/apache/log4j/layout/Log4j1XmlLayoutTest.java index d876c40..395cf3b 100644 --- a/log4j-1.2-api/src/test/java/org/apache/log4j/layout/Log4j1XmlLayoutTest.java +++ b/log4j-1.2-api/src/test/java/org/apache/log4j/layout/Log4j1XmlLayoutTest.java @@ -22,7 +22,7 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.core.impl.ContextDataFactory; import org.apache.logging.log4j.core.impl.Log4jLogEvent; import org.apache.logging.log4j.message.SimpleMessage; -import org.apache.logging.log4j.util.IndexedStringMap; +import org.apache.logging.log4j.util.StringMap; import org.junit.Test; public class Log4j1XmlLayoutTest { @@ -52,7 +52,7 @@ public class Log4j1XmlLayoutTest { public void testWithPropertiesAndLocationInfo() { final Log4j1XmlLayout layout = Log4j1XmlLayout.createLayout(true, true); -final IndexedStringMap contextMap = ContextDataFactory.createContextData(2); +final StringMap contextMap = ContextDataFactory.createContextData(2); contextMap.putValue("key1", "value1"); contextMap.putValue("key2", "value2"); final Log4jLogEvent event = Log4jLogEvent.newBuilder() http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f4eee5c6/log4j-1.2-api/src/test/java/org/apache/log4j/pattern/Log4j1MdcPatternConverterTest.java -- diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/pattern/Log4j1MdcPatternConverterTest.java b/log4j-1.2-api/src/test/java/org/apache/log4j/pattern/Log4j1MdcPatternConverterTest.java index 217e642..c1d5b83 100644 --- a/log4j-1.2-api/src/test/java/org/apache/log4j/pattern/Log4j1MdcPatternConverterTest.java +++ b/log4j-1.2-api/src/test/java/org/apache/log4j/pattern/Log4j1MdcPatternConverterTest.java @@ -23,21 +23,21 @@ import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.impl.ContextDataFactory; import org.apache.logging.log4j.core.impl.Log4jLogEvent; import org.apache.logging.log4j.message.SimpleMessage; -import org.apache.logging.log4j.util.IndexedStringMap; +import org.apache.logging.log4j.util.StringMap; import org.junit.Test; public class Log4j1MdcPatternConverterTest { @Test public void testConverter0() { -final IndexedStringMap contextMap = ContextDataFactory.createContextData(0); +final StringMap contextMap = ContextDataFactory.createContextData(0); final String expected = "{}"; test(contextMap, expected, null); } @Test public void testConverter1() { -final IndexedStringMap contextMap = ContextDataFactory.createContextData(1); +final StringMap contextMap = ContextDataFactory.createContextData(1); contextMap.putValue("key1", "value1"); final String expected = "{{key1,value1}}"; test(contextMap, expected, null); @@ -45,7 +45,7 @@ public class Log4j1MdcPatternConverterTest { @Test public void testConverter2() { -final IndexedStringMap contextMap = ContextDataFactory.createContextData(2); +final StringMap contextMap = ContextDataFactory.createContextData(2); contextMap.putValue("key1", "value1"); contextMap.putValue("key2", "value2"); final String expected = "{{key1,value1}{key2,value2}}";
logging-log4j2 git commit: LOG4J2-1944 Improve error message when no configuration file is found
Repository: logging-log4j2 Updated Branches: refs/heads/master 2e2b2d9bb -> e064ac404 LOG4J2-1944 Improve error message when no configuration file is found Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/e064ac40 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e064ac40 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e064ac40 Branch: refs/heads/master Commit: e064ac40404e0efd35d540ef9a76affc3340baca Parents: 2e2b2d9 Author: Mikael StåldalAuthored: Sat Jan 6 22:25:25 2018 +0100 Committer: Mikael Ståldal Committed: Sat Jan 6 22:25:25 2018 +0100 -- .../apache/logging/log4j/core/config/ConfigurationFactory.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e064ac40/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java index 3404a55..98ac069 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java @@ -389,10 +389,11 @@ public abstract class ConfigurationFactory extends ConfigurationBuilderFactory { if (config != null) { return config; } -LOGGER.error("No log4j2 configuration file found. " + +LOGGER.error("No Log4j 2 configuration file found. " + "Using default configuration: logging only errors to the console. " + "Set system property 'log4j2.debug' " + -"to show Log4j2 internal initialization logging."); +"to show Log4j 2 internal initialization logging. " + +"See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2"); return new DefaultConfiguration(); }
logging-log4j2 git commit: LOG4J2-2002 Avoid null attribute values in DefaultConfigurationBuilder
Repository: logging-log4j2 Updated Branches: refs/heads/master e33e950d7 -> 2e2b2d9bb LOG4J2-2002 Avoid null attribute values in DefaultConfigurationBuilder Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/2e2b2d9b Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/2e2b2d9b Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/2e2b2d9b Branch: refs/heads/master Commit: 2e2b2d9bb1cd20d35df2b1fa4ffc8ea8c5825b49 Parents: e33e950 Author: Mikael StåldalAuthored: Sat Jan 6 18:40:24 2018 +0100 Committer: Mikael Ståldal Committed: Sat Jan 6 18:40:24 2018 +0100 -- .../builder/api/ConfigurationBuilder.java | 58 .../impl/DefaultConfigurationBuilder.java | 39 + .../impl/DefaultLoggerComponentBuilder.java | 16 -- .../impl/DefaultRootLoggerComponentBuilder.java | 16 -- .../builder/ConfigurationBuilderTest.java | 5 ++ src/changes/changes.xml | 3 + 6 files changed, 129 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2e2b2d9b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java index c88cb09..e10f292 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java @@ -134,6 +134,22 @@ public interface ConfigurationBuilder extends Builder extends Builder extends Builder extends Builderhttp://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2e2b2d9b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java index 472ac3d..1559b01 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java @@ -356,6 +356,16 @@ public class DefaultConfigurationBuilder implement } @Override +public LoggerComponentBuilder newAsyncLogger(String name) { +return new DefaultLoggerComponentBuilder(this, name, null, "AsyncLogger"); +} + +@Override +public LoggerComponentBuilder newAsyncLogger(String name, boolean includeLocation) { +return new DefaultLoggerComponentBuilder(this, name, null, "AsyncLogger", includeLocation); +} + +@Override public LoggerComponentBuilder newAsyncLogger(final String name, final Level level) { return new DefaultLoggerComponentBuilder(this, name, level.toString(), "AsyncLogger"); } @@ -376,6 +386,16 @@ public class DefaultConfigurationBuilder implement } @Override +public RootLoggerComponentBuilder newAsyncRootLogger() { +return new DefaultRootLoggerComponentBuilder(this, "AsyncRoot"); +} + +@Override +public RootLoggerComponentBuilder newAsyncRootLogger(boolean includeLocation) { +return new DefaultRootLoggerComponentBuilder(this, null, "AsyncRoot", includeLocation); +} + +@Override public RootLoggerComponentBuilder newAsyncRootLogger(final Level level) { return new DefaultRootLoggerComponentBuilder(this, level.toString(), "AsyncRoot"); } @@ -443,6 +463,15 @@ public class DefaultConfigurationBuilder implement return new DefaultLayoutComponentBuilder(this, type); } +@Override +public LoggerComponentBuilder newLogger(String name) { +return new DefaultLoggerComponentBuilder(this, name, null); +} + +@Override +public LoggerComponentBuilder newLogger(String name, boolean includeLocation) { +return new DefaultLoggerComponentBuilder(this, name, null, includeLocation); +} @Override public LoggerComponentBuilder newLogger(final String name, final Level level) { @@ -465,6 +494,16 @@ public class DefaultConfigurationBuilder implement } @Override +public RootLoggerComponentBuilder newRootLogger() { +return new DefaultRootLoggerComponentBuilder(this,
logging-log4j2 git commit: LOG4J2-2175 Fix typo in Property Substitution docs
Repository: logging-log4j2 Updated Branches: refs/heads/master bd9074fe6 -> e33e950d7 LOG4J2-2175 Fix typo in Property Substitution 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/e33e950d Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e33e950d Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e33e950d Branch: refs/heads/master Commit: e33e950d75a81ffdc3f69076fb10243260b10dd4 Parents: bd9074f Author: Mikael StåldalAuthored: Sat Jan 6 17:53:24 2018 +0100 Committer: Mikael Ståldal Committed: Sat Jan 6 17:53:24 2018 +0100 -- src/changes/changes.xml | 4 +++- src/site/xdoc/manual/configuration.xml.vm | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e33e950d/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index af86785..4727548 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -31,7 +31,9 @@ - "remove" - Removed --> - + +Fix typo in Property Substitution docs. + Allow SortedArrayStringMap to be filtered upon deserialization. Fix build error in Java 9 when compiling log4j-core test classes. http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e33e950d/src/site/xdoc/manual/configuration.xml.vm -- diff --git a/src/site/xdoc/manual/configuration.xml.vm b/src/site/xdoc/manual/configuration.xml.vm index 04ef5b1..0890b39 100644 --- a/src/site/xdoc/manual/configuration.xml.vm +++ b/src/site/xdoc/manual/configuration.xml.vm @@ -1070,7 +1070,7 @@ rootLogger.appenderRef.stdout.ref = STDOUT multiple leading '$' characters each time the variable is resolved the leading '$' is simply removed. In the previous example the "Routes" element is capable of resolving the variable at runtime. To allow this the prefix value is specified as a variable with two leading '$' characters. When the configuration -file is first processed the first variable is simply removed. Thus, when the Routes element is evaluated +file is first processed the first '$' character is simply removed. Thus, when the Routes element is evaluated at runtime it is the variable declaration "${dollar}{sd:type}" which causes the event to be inspected for a StructuredDataMessage and if one is present the value of its type attribute to be used as the routing key. Not all elements support resolving variables at runtime. Components that do will specifically call that
[1/2] logging-log4j-tools git commit: LOG4J2-2163 Deprecate ObjectInputStreamLogEventBridge
Repository: logging-log4j-tools Updated Branches: refs/heads/master 9b93b3fb5 -> afa3230de LOG4J2-2163 Deprecate ObjectInputStreamLogEventBridge Project: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/commit/017ae957 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/tree/017ae957 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/diff/017ae957 Branch: refs/heads/master Commit: 017ae95760be63eb9212ee5c450b165d966a67bb Parents: 9b93b3f Author: Mikael StåldalAuthored: Fri Dec 29 12:31:25 2017 +0100 Committer: Mikael Ståldal Committed: Fri Dec 29 12:31:25 2017 +0100 -- .../logging/log4j/server/ObjectInputStreamLogEventBridge.java | 7 ++- .../java/org/apache/logging/log4j/server/TcpSocketServer.java | 3 +++ .../java/org/apache/logging/log4j/server/UdpSocketServer.java | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/blob/017ae957/log4j-server/src/main/java/org/apache/logging/log4j/server/ObjectInputStreamLogEventBridge.java -- diff --git a/log4j-server/src/main/java/org/apache/logging/log4j/server/ObjectInputStreamLogEventBridge.java b/log4j-server/src/main/java/org/apache/logging/log4j/server/ObjectInputStreamLogEventBridge.java index 428ab83..c5ab4eb 100644 --- a/log4j-server/src/main/java/org/apache/logging/log4j/server/ObjectInputStreamLogEventBridge.java +++ b/log4j-server/src/main/java/org/apache/logging/log4j/server/ObjectInputStreamLogEventBridge.java @@ -25,10 +25,15 @@ import java.util.List; import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.LogEventListener; import org.apache.logging.log4j.util.FilteredObjectInputStream; +import org.apache.logging.log4j.core.layout.SerializedLayout; /** - * Reads and logs serialized {@link LogEvent} objects from an {@link ObjectInputStream}. + * Reads and logs serialized {@link LogEvent} objects (created with {@link SerializedLayout}) from an {@link ObjectInputStream}. + * + * @deprecated Java Serialization has inherent security weaknesses, see https://www.owasp.org/index.php/Deserialization_of_untrusted_data . + * Therefore {@link SerializedLayout} is deprecated, and so is this class. We recommend using {@link JsonInputStreamLogEventBridge} instead. */ +@Deprecated public class ObjectInputStreamLogEventBridge extends AbstractLogEventBridge { private final List allowedClasses; http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/blob/017ae957/log4j-server/src/main/java/org/apache/logging/log4j/server/TcpSocketServer.java -- diff --git a/log4j-server/src/main/java/org/apache/logging/log4j/server/TcpSocketServer.java b/log4j-server/src/main/java/org/apache/logging/log4j/server/TcpSocketServer.java index 52eafcc..6d163fe 100644 --- a/log4j-server/src/main/java/org/apache/logging/log4j/server/TcpSocketServer.java +++ b/log4j-server/src/main/java/org/apache/logging/log4j/server/TcpSocketServer.java @@ -161,6 +161,7 @@ public class TcpSocketServer extends AbstractSocketServer * @throws IOException * if an I/O error occurs when opening the socket. */ +@Deprecated public static TcpSocketServer createSerializedSocketServer(final int port) throws IOException { LOGGER.entry(port); final TcpSocketServer socketServer = new TcpSocketServer<>(port, new ObjectInputStreamLogEventBridge()); @@ -181,6 +182,7 @@ public class TcpSocketServer extends AbstractSocketServer * if an I/O error occurs when opening the socket. * @since 2.7 */ +@Deprecated public static TcpSocketServer createSerializedSocketServer(final int port, final int backlog, final InetAddress localBindAddress) throws IOException { return createSerializedSocketServer(port, backlog, localBindAddress, Collections.emptyList()); @@ -201,6 +203,7 @@ public class TcpSocketServer extends AbstractSocketServer * if an I/O error occurs when opening the socket. * @since 2.8.2 */ +@Deprecated public static TcpSocketServer createSerializedSocketServer( final int port, final int backlog, final InetAddress localBindAddress, final List allowedClasses ) throws IOException { http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/blob/017ae957/log4j-server/src/main/java/org/apache/logging/log4j/server/UdpSocketServer.java -- diff --git a/log4j-server/src/main/java/org/apache/logging/log4j/server/UdpSocketServer.java
[2/2] logging-log4j-tools git commit: Fix typo
Fix typo Project: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/commit/afa3230d Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/tree/afa3230d Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/diff/afa3230d Branch: refs/heads/master Commit: afa3230de200df4e3a24dfd56c78d4322ca0a3f1 Parents: 017ae95 Author: Mikael StåldalAuthored: Fri Dec 29 12:31:50 2017 +0100 Committer: Mikael Ståldal Committed: Fri Dec 29 12:31:50 2017 +0100 -- .../main/java/org/apache/logging/log4j/server/TcpSocketServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/blob/afa3230d/log4j-server/src/main/java/org/apache/logging/log4j/server/TcpSocketServer.java -- diff --git a/log4j-server/src/main/java/org/apache/logging/log4j/server/TcpSocketServer.java b/log4j-server/src/main/java/org/apache/logging/log4j/server/TcpSocketServer.java index 6d163fe..71e89e1 100644 --- a/log4j-server/src/main/java/org/apache/logging/log4j/server/TcpSocketServer.java +++ b/log4j-server/src/main/java/org/apache/logging/log4j/server/TcpSocketServer.java @@ -348,7 +348,7 @@ public class TcpSocketServer extends AbstractSocketServer logger.debug("Listening for a connection {}...", serverSocket); @SuppressWarnings("resource") // clientSocket is closed during SocketHandler shutdown final Socket clientSocket = serverSocket.accept(); -logger.debug("Acepted connection on {}...", serverSocket); +logger.debug("Accepted connection on {}...", serverSocket); logger.debug("Socket accepted: {}", clientSocket); clientSocket.setSoLinger(true, 0);
logging-log4j-tools git commit: LOG4J2-2163 Use FilteredObjectInputStream from log4j-api
Repository: logging-log4j-tools Updated Branches: refs/heads/master e75bafd39 -> 9b93b3fb5 LOG4J2-2163 Use FilteredObjectInputStream from log4j-api Project: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/commit/9b93b3fb Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/tree/9b93b3fb Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/diff/9b93b3fb Branch: refs/heads/master Commit: 9b93b3fb56a3dde1a88f962bd4658d19f520ee2e Parents: e75bafd Author: Mikael StåldalAuthored: Fri Dec 29 12:19:53 2017 +0100 Committer: Mikael Ståldal Committed: Fri Dec 29 12:19:53 2017 +0100 -- .../log4j/server/FilteredObjectInputStream.java | 67 .../server/ObjectInputStreamLogEventBridge.java | 1 + 2 files changed, 1 insertion(+), 67 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/blob/9b93b3fb/log4j-server/src/main/java/org/apache/logging/log4j/server/FilteredObjectInputStream.java -- diff --git a/log4j-server/src/main/java/org/apache/logging/log4j/server/FilteredObjectInputStream.java b/log4j-server/src/main/java/org/apache/logging/log4j/server/FilteredObjectInputStream.java deleted file mode 100644 index c5bf92f..000 --- a/log4j-server/src/main/java/org/apache/logging/log4j/server/FilteredObjectInputStream.java +++ /dev/null @@ -1,67 +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 express or implied. - * See the license for the specific language governing permissions and - * limitations under the license. - */ -package org.apache.logging.log4j.server; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InvalidObjectException; -import java.io.ObjectInputStream; -import java.io.ObjectStreamClass; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - -/** - * Extended ObjectInputStream that only allows certain classes to be deserialized. - * - * @since 2.8.2 - */ -public class FilteredObjectInputStream extends ObjectInputStream { - -private static final List REQUIRED_JAVA_CLASSES = Arrays.asList( -// for StandardLevel -"java.lang.Enum", -// for location information -"java.lang.StackTraceElement", -// for Message delegate -"java.rmi.MarshalledObject", -"[B" -); - -private final Collection allowedClasses; - -public FilteredObjectInputStream(final InputStream in, final Collection allowedClasses) throws IOException { -super(in); -this.allowedClasses = allowedClasses; -} - -@Override -protected Class resolveClass(final ObjectStreamClass desc) throws IOException, ClassNotFoundException { -String name = desc.getName(); -if (!(isAllowedByDefault(name) || allowedClasses.contains(name))) { -throw new InvalidObjectException("Class is not allowed for deserialization: " + name); -} -return super.resolveClass(desc); -} - -private static boolean isAllowedByDefault(final String name) { -return name.startsWith("org.apache.logging.log4j.") || -name.startsWith("[Lorg.apache.logging.log4j.") || -REQUIRED_JAVA_CLASSES.contains(name); -} - -} http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/blob/9b93b3fb/log4j-server/src/main/java/org/apache/logging/log4j/server/ObjectInputStreamLogEventBridge.java -- diff --git a/log4j-server/src/main/java/org/apache/logging/log4j/server/ObjectInputStreamLogEventBridge.java b/log4j-server/src/main/java/org/apache/logging/log4j/server/ObjectInputStreamLogEventBridge.java index 0f4a06f..428ab83 100644 --- a/log4j-server/src/main/java/org/apache/logging/log4j/server/ObjectInputStreamLogEventBridge.java +++ b/log4j-server/src/main/java/org/apache/logging/log4j/server/ObjectInputStreamLogEventBridge.java @@ -24,6 +24,7 @@ import java.util.List; import org.apache.logging.log4j.core.LogEvent; import
logging-log4j-tools git commit: Upgrade to latest Log4j
Repository: logging-log4j-tools Updated Branches: refs/heads/master 9bbf5f437 -> e75bafd39 Upgrade to latest Log4j Project: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/commit/e75bafd3 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/tree/e75bafd3 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/diff/e75bafd3 Branch: refs/heads/master Commit: e75bafd39d4a1aa1d15ea62b78f5baf5d40ba3ab Parents: 9bbf5f4 Author: Mikael StåldalAuthored: Mon Dec 11 20:41:49 2017 +0100 Committer: Mikael Ståldal Committed: Mon Dec 11 20:41:49 2017 +0100 -- log4j-server/pom.xml | 2 +- .../org/apache/logging/log4j/server/SslXmlSocketServerTest.java | 4 ++-- pom.xml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/blob/e75bafd3/log4j-server/pom.xml -- diff --git a/log4j-server/pom.xml b/log4j-server/pom.xml index d5493c3..6ef00c5 100644 --- a/log4j-server/pom.xml +++ b/log4j-server/pom.xml @@ -20,7 +20,7 @@ org.apache.logging.log4j log4j-tools -2.9-SNAPSHOT +2.10.1-SNAPSHOT ../ log4j-server http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/blob/e75bafd3/log4j-server/src/test/java/org/apache/logging/log4j/server/SslXmlSocketServerTest.java -- diff --git a/log4j-server/src/test/java/org/apache/logging/log4j/server/SslXmlSocketServerTest.java b/log4j-server/src/test/java/org/apache/logging/log4j/server/SslXmlSocketServerTest.java index 1a4acb4..42a9e9e 100644 --- a/log4j-server/src/test/java/org/apache/logging/log4j/server/SslXmlSocketServerTest.java +++ b/log4j-server/src/test/java/org/apache/logging/log4j/server/SslXmlSocketServerTest.java @@ -42,9 +42,9 @@ public class SslXmlSocketServerTest extends AbstractSocketServerTest { private static void initServerSocketFactory() throws StoreConfigurationException { final KeyStoreConfiguration ksc = new KeyStoreConfiguration(TestConstants.KEYSTORE_FILE, -TestConstants.KEYSTORE_PWD, TestConstants.KEYSTORE_TYPE, null); +TestConstants.KEYSTORE_PWD(), TestConstants.KEYSTORE_TYPE, null); final TrustStoreConfiguration tsc = new TrustStoreConfiguration(TestConstants.TRUSTSTORE_FILE, -TestConstants.TRUSTSTORE_PWD, null, null); +TestConstants.TRUSTSTORE_PWD(), null, null); sslConfiguration = SslConfiguration.createSSLConfiguration(null, ksc, tsc); } http://git-wip-us.apache.org/repos/asf/logging-log4j-tools/blob/e75bafd3/pom.xml -- diff --git a/pom.xml b/pom.xml index ca95638..b520cae 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ log4j-tools pom Apache Log4j 2 Tools - 2.9-SNAPSHOT + 2.10.1-SNAPSHOT org.apache.logging logging-parent @@ -166,7 +166,7 @@ ${basedir} -2.8.2 +2.10.0 Matt Sicker
logging-log4j2 git commit: LOG4J2-2143 Fix documentation
Repository: logging-log4j2 Updated Branches: refs/heads/master 0c67dc6b5 -> e752db5e7 LOG4J2-2143 Fix documentation Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/e752db5e Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e752db5e Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e752db5e Branch: refs/heads/master Commit: e752db5e752d6e1b0ec86d80fd57548c625de731 Parents: 0c67dc6 Author: Mikael StåldalAuthored: Mon Dec 11 20:23:53 2017 +0100 Committer: Mikael Ståldal Committed: Mon Dec 11 20:23:53 2017 +0100 -- src/site/xdoc/manual/layouts.xml.vm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e752db5e/src/site/xdoc/manual/layouts.xml.vm -- diff --git a/src/site/xdoc/manual/layouts.xml.vm b/src/site/xdoc/manual/layouts.xml.vm index 3e8e2a5..070f5fa 100644 --- a/src/site/xdoc/manual/layouts.xml.vm +++ b/src/site/xdoc/manual/layouts.xml.vm @@ -1598,7 +1598,7 @@ WARN [main]: Message 2 fqcn - Outputs the fully qualified class name of the logging event. + Outputs the fully qualified class name of the logger.
logging-log4j2 git commit: LOG4J2-2143 Add missing converters to PatternLayout
Repository: logging-log4j2 Updated Branches: refs/heads/master 2ea183ee7 -> 7a6c356d0 LOG4J2-2143 Add missing converters to PatternLayout Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/7a6c356d Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/7a6c356d Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/7a6c356d Branch: refs/heads/master Commit: 7a6c356d0e898822b4da8fc1cc3dcc9ac59f5cff Parents: 2ea183e Author: Mikael StåldalAuthored: Wed Dec 6 22:11:54 2017 +0100 Committer: Mikael Ståldal Committed: Wed Dec 6 22:11:54 2017 +0100 -- .../pattern/EndOfBatchPatternConverter.java | 63 .../pattern/LoggerFqcnPatternConverter.java | 63 .../pattern/EndOfBatchPatternConverterTest.java | 47 +++ .../pattern/LoggerFqcnPatternConverterTest.java | 38 .../log4j/core/pattern/PatternParserTest.java | 10 src/changes/changes.xml | 3 + src/site/xdoc/manual/layouts.xml.vm | 14 + 7 files changed, 238 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7a6c356d/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/EndOfBatchPatternConverter.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/EndOfBatchPatternConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/EndOfBatchPatternConverter.java new file mode 100644 index 000..a2f95fd --- /dev/null +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/EndOfBatchPatternConverter.java @@ -0,0 +1,63 @@ +/* + * 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.pattern; + +import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.core.config.plugins.Plugin; +import org.apache.logging.log4j.util.PerformanceSensitive; + +/** + * Formats the EndOfBatch. + * + * @since 2.10.1 + */ +@Plugin(name = "EndOfBatchPatternConverter", category = PatternConverter.CATEGORY) +@ConverterKeys({ "endOfBatch" }) +@PerformanceSensitive("allocation") +public final class EndOfBatchPatternConverter extends LogEventPatternConverter { +/** + * Singleton. + */ +private static final EndOfBatchPatternConverter INSTANCE = +new EndOfBatchPatternConverter(); + +/** + * Private constructor. + */ +private EndOfBatchPatternConverter() { +super("LoggerFqcn", "loggerFqcn"); +} + +/** + * Obtains an instance of EndOfBatchPatternConverter. + * + * @param options options, currently ignored, may be null. + * @return instance of EndOfBatchPatternConverter. + */ +public static EndOfBatchPatternConverter newInstance( +final String[] options) { +return INSTANCE; +} + +/** + * {@inheritDoc} + */ +@Override +public void format(final LogEvent event, final StringBuilder toAppendTo) { +toAppendTo.append(event.isEndOfBatch()); +} +} http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7a6c356d/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LoggerFqcnPatternConverter.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LoggerFqcnPatternConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LoggerFqcnPatternConverter.java new file mode 100644 index 000..9eb4296 --- /dev/null +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LoggerFqcnPatternConverter.java @@ -0,0 +1,63 @@ +/* + * 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
logging-log4j2 git commit: LOG4J2-2007 unit test
Repository: logging-log4j2 Updated Branches: refs/heads/master 41d126107 -> 2ea183ee7 LOG4J2-2007 unit 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/2ea183ee Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/2ea183ee Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/2ea183ee Branch: refs/heads/master Commit: 2ea183ee7ab530005e5e395deeac003a432b5cc7 Parents: 41d1261 Author: Mikael StåldalAuthored: Thu Nov 30 21:53:38 2017 +0100 Committer: Mikael Ståldal Committed: Sun Dec 3 12:48:55 2017 +0100 -- .../core/appender/SmtpAppenderAsyncTest.java| 98 .../test/resources/SmtpAppenderAsyncTest.xml| 42 + 2 files changed, 140 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2ea183ee/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SmtpAppenderAsyncTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SmtpAppenderAsyncTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SmtpAppenderAsyncTest.java new file mode 100644 index 000..91503d3 --- /dev/null +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SmtpAppenderAsyncTest.java @@ -0,0 +1,98 @@ +/* + * 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; + +import org.apache.logging.dumbster.smtp.SimpleSmtpServer; +import org.apache.logging.dumbster.smtp.SmtpMessage; +import org.apache.logging.log4j.ThreadContext; +import org.apache.logging.log4j.core.Logger; +import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.test.AvailablePortFinder; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.Test; + +import java.util.Iterator; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +public class SmtpAppenderAsyncTest { + +private static int PORT; + +private SimpleSmtpServer smtpServer; + +@BeforeClass +public static void setupClass() { +PORT = AvailablePortFinder.getNextAvailable(); +System.setProperty("smtp.port", String.valueOf(PORT)); +} + +@Before +public void setup() { +smtpServer = SimpleSmtpServer.start(PORT); +} + +@Rule +public LoggerContextRule ctx = new LoggerContextRule("SmtpAppenderAsyncTest.xml"); + +@Test +public void testSync() { +testSmtpAppender(ctx.getLogger("sync")); +} + +@Test +public void testAsync() { +testSmtpAppender(ctx.getLogger("async")); +} + +private void testSmtpAppender(Logger logger) { +ThreadContext.put("MDC1", "mdc1"); +logger.error("the message"); +ctx.getLoggerContext().stop(); +smtpServer.stop(); + +assertEquals(1, smtpServer.getReceivedEmailSize()); +final Iterator messages = smtpServer.getReceivedEmail(); +final SmtpMessage email = messages.next(); + +assertEquals("t...@example.com", email.getHeaderValue("To")); +assertEquals("f...@example.com", email.getHeaderValue("From")); +assertEquals("[mdc1]", email.getHeaderValue("Subject")); + +String body = email.getBody(); +if (!body.contains("Body:[mdc1]")) { +fail(body); +} +} + +@After +public void teardown() { +if (smtpServer != null) { +smtpServer.stop(); +} +} + +@AfterClass +public static void teardownClass() { +System.clearProperty("smtp.port"); +} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2ea183ee/log4j-core/src/test/resources/SmtpAppenderAsyncTest.xml -- diff --git
svn commit: r1021550 - /websites/production/logging/content/log4j/log4j-2.10.0/manual/configuration.html
Author: mikes Date: Thu Nov 30 19:42:30 2017 New Revision: 1021550 Log: LOG4J2-2087 Update documentation Modified: websites/production/logging/content/log4j/log4j-2.10.0/manual/configuration.html Modified: websites/production/logging/content/log4j/log4j-2.10.0/manual/configuration.html == --- websites/production/logging/content/log4j/log4j-2.10.0/manual/configuration.html (original) +++ websites/production/logging/content/log4j/log4j-2.10.0/manual/configuration.html Thu Nov 30 19:42:30 2017 @@ -2614,7 +2614,7 @@ public class AwesomeTest { log4j.skipJansi -false +true If true, the ConsoleAppender will not try to use the Jansi output stream on Windows.
logging-log4j2 git commit: LOG4J2-2087 Update documentation
Repository: logging-log4j2 Updated Branches: refs/heads/master 4654f30aa -> 41d126107 LOG4J2-2087 Update documentation Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/41d12610 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/41d12610 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/41d12610 Branch: refs/heads/master Commit: 41d1261071a6694dc337b76c73aed5119213f16b Parents: 4654f30 Author: Mikael StåldalAuthored: Thu Nov 30 20:33:06 2017 +0100 Committer: Mikael Ståldal Committed: Thu Nov 30 20:33:06 2017 +0100 -- src/site/xdoc/manual/configuration.xml.vm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/41d12610/src/site/xdoc/manual/configuration.xml.vm -- diff --git a/src/site/xdoc/manual/configuration.xml.vm b/src/site/xdoc/manual/configuration.xml.vm index 3367d2c..04ef5b1 100644 --- a/src/site/xdoc/manual/configuration.xml.vm +++ b/src/site/xdoc/manual/configuration.xml.vm @@ -1856,7 +1856,7 @@ public class AwesomeTest { log4j2.skipJansi LOG4J_SKIP_JANSI log4j.skipJansi -false +true If true, the ConsoleAppender will not try to use the Jansi output stream on Windows.
svn commit: r1021515 - /websites/production/logging/content/log4j/log4j-2.10.0/manual/layouts.html
Author: mikes Date: Wed Nov 29 21:16:47 2017 New Revision: 1021515 Log: LOG4J2-2136 Clarify that additional fields in Gelf, Json, Xml and Yaml layouts support lookups Modified: websites/production/logging/content/log4j/log4j-2.10.0/manual/layouts.html Modified: websites/production/logging/content/log4j/log4j-2.10.0/manual/layouts.html == --- websites/production/logging/content/log4j/log4j-2.10.0/manual/layouts.html (original) +++ websites/production/logging/content/log4j/log4j-2.10.0/manual/layouts.html Wed Nov 29 21:16:47 2017 @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - + http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> @@ -28,7 +28,7 @@ - + @@ -617,10 +617,7 @@ logger.debug(one={}, two={}, three Appenders Socket name=Graylog protocol=udp host=graylog.domain.com port=12201 -GelfLayout host=someserver compressionType=ZLIB compressionThreshold=1024 -KeyValuePair key=additionalField1 value=constant value/ -KeyValuePair key=additionalField2 value=$${ctx:key}/ -/GelfLayout +GelfLayout host=someserver compressionType=ZLIB compressionThreshold=1024/ /Socket /Appenders @@ -633,10 +630,7 @@ logger.debug(one={}, two={}, three Appenders Socket name=Graylog protocol=tcp host=graylog.domain.com port=12201 -GelfLayout host=someserver compressionType=OFF includeNullDelimiter=true -KeyValuePair key=additionalField1 value=constant value/ -KeyValuePair key=additionalField2 value=$${ctx:key}/ -/GelfLayout +GelfLayout host=someserver compressionType=OFF includeNullDelimiter=true/ /Socket /Appenders @@ -710,15 +704,31 @@ logger.debug(one={}, two={}, three - + - See also: - - + To include any custom field in the output, use following syntax: + + + + + GelfLayout +KeyValuePair key=additionalField1 value=constant value/ +KeyValuePair key=additionalField2 value=$${ctx:key}/ + /GelfLayout + + + + Custom fields are included in the order they are declared. The values support lookups. + + + +See also: + + - + The http://docs.graylog.org/en/latest/pages/gelf.html#gelf;>GELF specification - + @@ -1011,7 +1021,8 @@ logger.debug(one={}, two={}, three To include any custom field in the output, use following syntax: - + + JsonLayout @@ -1019,8 +1030,10 @@ logger.debug(one={}, two={}, three KeyValuePair key=additionalField2 value=$${ctx:key}/ /JsonLayout - Custom fields are always last, in the order they are declared. + + Custom fields are always last, in the order they are declared. The values support lookups. + Additional runtime dependencies are required for using JsonLayout. @@ -3626,7 +3639,8 @@ at org.apache.logging.log4j.core.pattern To include any custom field in the output, use following syntax: - + + XmlLayout @@ -3634,8 +3648,10 @@ at org.apache.logging.log4j.core.pattern KeyValuePair key=additionalField2 value=$${ctx:key}/ /XmlLayout - Custom fields are always last, in the order they are declared. + + Custom fields are always last, in the order they are declared. The values support lookups. + Additional runtime dependencies are required for using XmlLayout. @@ -3773,7 +3789,8 @@ source: To include any custom field in the output, use following syntax: - + + YamlLayout @@ -3781,8 +3798,10 @@ source: KeyValuePair key=additionalField2 value=$${ctx:key}/ /YamlLayout - Custom fields are always last, in the order they are declared. + + Custom fields are always last, in the order they are declared. The values support lookups. + Additional runtime dependencies are required for using YamlLayout.
logging-log4j2 git commit: LOG4J2-2136 Clarify that additional fields in Gelf, Json, Xml and Yaml layouts support lookups
Repository: logging-log4j2 Updated Branches: refs/heads/master c96ad2585 -> 4654f30aa LOG4J2-2136 Clarify that additional fields in Gelf, Json, Xml and Yaml layouts support lookups Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/4654f30a Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/4654f30a Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/4654f30a Branch: refs/heads/master Commit: 4654f30aaf45dd8dc4243b65271ecda98df977b1 Parents: c96ad25 Author: Mikael StåldalAuthored: Wed Nov 29 22:10:40 2017 +0100 Committer: Mikael Ståldal Committed: Wed Nov 29 22:10:40 2017 +0100 -- src/site/xdoc/manual/layouts.xml.vm | 46 1 file changed, 29 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/4654f30a/src/site/xdoc/manual/layouts.xml.vm -- diff --git a/src/site/xdoc/manual/layouts.xml.vm b/src/site/xdoc/manual/layouts.xml.vm index ab61955..3cfab4a 100644 --- a/src/site/xdoc/manual/layouts.xml.vm +++ b/src/site/xdoc/manual/layouts.xml.vm @@ -202,10 +202,7 @@ logger.debug("one={}, two={}, three={}", 1, 2, 3); Appenders Socket name="Graylog" protocol="udp" host="graylog.domain.com" port="12201" -GelfLayout host="someserver" compressionType="ZLIB" compressionThreshold="1024" -KeyValuePair key="additionalField1" value="constant value"/ -KeyValuePair key="additionalField2" value="${dollar}${dollar}{ctx:key}"/ -/GelfLayout +GelfLayout host="someserver" compressionType="ZLIB" compressionThreshold="1024"/ /Socket /Appenders @@ -215,10 +212,7 @@ logger.debug("one={}, two={}, three={}", 1, 2, 3); Appenders Socket name="Graylog" protocol="tcp" host="graylog.domain.com" port="12201" -GelfLayout host="someserver" compressionType="OFF" includeNullDelimiter="true" -KeyValuePair key="additionalField1" value="constant value"/ -KeyValuePair key="additionalField2" value="${dollar}${dollar}{ctx:key}"/ -/GelfLayout +GelfLayout host="someserver" compressionType="OFF" includeNullDelimiter="true"/ /Socket /Appenders @@ -263,12 +257,24 @@ logger.debug("one={}, two={}, three={}", 1, 2, 3); GelfLayout Parameters - - See also: - - - The http://docs.graylog.org/en/latest/pages/gelf.html#gelf;>GELF specification - + + To include any custom field in the output, use following syntax: + + + GelfLayout +KeyValuePair key="additionalField1" value="constant value"/ +KeyValuePair key="additionalField2" value="${dollar}${dollar}{ctx:key}"/ + /GelfLayout + + + Custom fields are included in the order they are declared. The values support lookups. + + +See also: + + +The http://docs.graylog.org/en/latest/pages/gelf.html#gelf;>GELF specification + @@ -464,13 +470,15 @@ logger.debug("one={}, two={}, three={}", 1, 2, 3); To include any custom field in the output, use following syntax: + JsonLayout KeyValuePair key="additionalField1" value="constant value"/ KeyValuePair key="additionalField2" value="${dollar}${dollar}{ctx:key}"/ /JsonLayout - Custom fields are always last, in the order they are declared. + + Custom fields are always last, in the order they are declared. The values support lookups. Additional runtime dependencies are required for using JsonLayout. @@ -2246,13 +2254,15 @@ at org.apache.logging.log4j.core.pattern.ExtendedThrowableTest.testException(Ext To include any custom field in the output, use following syntax: + XmlLayout KeyValuePair key="additionalField1" value="constant value"/ KeyValuePair key="additionalField2" value="${dollar}${dollar}{ctx:key}"/ /XmlLayout - Custom fields are always last, in the order they are declared. + + Custom fields are always last, in the order they are declared. The values support lookups. Additional runtime dependencies are required for using XmlLayout. @@ -2351,13 +2361,15 @@ source: To include any custom field in the output, use following syntax: +
svn commit: r1021376 - in /websites/production/logging/content/log4j/log4j-2.10.0: maven-artifacts.html runtime-dependencies.html
Author: mikes Date: Sun Nov 26 11:18:18 2017 New Revision: 1021376 Log: Fix Scala API version Modified: websites/production/logging/content/log4j/log4j-2.10.0/maven-artifacts.html websites/production/logging/content/log4j/log4j-2.10.0/runtime-dependencies.html Modified: websites/production/logging/content/log4j/log4j-2.10.0/maven-artifacts.html == --- websites/production/logging/content/log4j/log4j-2.10.0/maven-artifacts.html (original) +++ websites/production/logging/content/log4j/log4j-2.10.0/maven-artifacts.html Sun Nov 26 11:18:18 2017 @@ -873,7 +873,7 @@ dependencies { -libraryDependencies += org.apache.logging.log4j %% log4j-api-scala % 2.10.0 +libraryDependencies += org.apache.logging.log4j %% log4j-api-scala % 11.0 Maven, Ivy, and Gradle users need to add the Scala version to the artifact name. Scala 2.12 users can use the following: @@ -885,7 +885,7 @@ dependencies { dependency groupIdorg.apache.logging.log4j/groupId artifactIdlog4j-api-scala_2.12/artifactId -version2.10.0/version +version11.0/version /dependency /dependencies @@ -894,7 +894,7 @@ dependencies { dependencies - dependency org=org.apache.logging.log4j name=log4j-api-scala_2.12 rev=2.10.0 / + dependency org=org.apache.logging.log4j name=log4j-api-scala_2.12 rev=11.0 / /dependencies build.gradle @@ -902,7 +902,7 @@ dependencies { dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-api-scala_2.12', version: '2.10.0' + compile group: 'org.apache.logging.log4j', name: 'log4j-api-scala_2.12', version: '11.0' } Scala 2.11 users can use the following: @@ -914,7 +914,7 @@ dependencies { dependency groupIdorg.apache.logging.log4j/groupId artifactIdlog4j-api-scala_2.11/artifactId -version2.10.0/version +version11.0/version /dependency /dependencies @@ -923,7 +923,7 @@ dependencies { dependencies - dependency org=org.apache.logging.log4j name=log4j-api-scala_2.11 rev=2.10.0 / + dependency org=org.apache.logging.log4j name=log4j-api-scala_2.11 rev=11.0 / /dependencies build.gradle @@ -931,7 +931,7 @@ dependencies { dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-api-scala_2.11', version: '2.10.0' + compile group: 'org.apache.logging.log4j', name: 'log4j-api-scala_2.11', version: '11.0' } Scala 2.10 users can use the following: @@ -943,7 +943,7 @@ dependencies { dependency groupIdorg.apache.logging.log4j/groupId artifactIdlog4j-api-scala_2.10/artifactId -version2.10.0/version +version11.0/version /dependency /dependencies @@ -952,7 +952,7 @@ dependencies { dependencies - dependency org=org.apache.logging.log4j name=log4j-api-scala_2.10 rev=2.10.0 / + dependency org=org.apache.logging.log4j name=log4j-api-scala_2.10 rev=11.0 / /dependencies build.gradle @@ -960,7 +960,7 @@ dependencies { dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-api-scala_2.10', version: '2.10.0' + compile group: 'org.apache.logging.log4j', name: 'log4j-api-scala_2.10', version: '11.0' } Modified: websites/production/logging/content/log4j/log4j-2.10.0/runtime-dependencies.html == --- websites/production/logging/content/log4j/log4j-2.10.0/runtime-dependencies.html (original) +++ websites/production/logging/content/log4j/log4j-2.10.0/runtime-dependencies.html Sun Nov 26 11:18:18 2017 @@ -924,7 +924,7 @@ log4j-api-scala -The Log4j Scala API requires Scala runtime library and reflection in +The Log4j Scala API requires Scala runtime library and reflection in addition to the Log4j API.
logging-log4j2 git commit: Fix Scala API version
Repository: logging-log4j2 Updated Branches: refs/heads/master fc098dd6e -> a03a3322a Fix Scala API 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/a03a3322 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a03a3322 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a03a3322 Branch: refs/heads/master Commit: a03a3322a91894a1c2951b72c1f2498a7bbd0f2b Parents: fc098dd Author: Mikael StåldalAuthored: Sat Nov 25 15:50:40 2017 +0100 Committer: Mikael Ståldal Committed: Sat Nov 25 15:50:40 2017 +0100 -- src/site/markdown/maven-artifacts.md.vm | 40 ++-- 1 file changed, 26 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a03a3322/src/site/markdown/maven-artifacts.md.vm -- diff --git a/src/site/markdown/maven-artifacts.md.vm b/src/site/markdown/maven-artifacts.md.vm index 175fb2f..6780dd8 100644 --- a/src/site/markdown/maven-artifacts.md.vm +++ b/src/site/markdown/maven-artifacts.md.vm @@ -19,6 +19,9 @@ #set($h2='##') #set($h3='###') #macro(maven $artifactIds) +#mavenVersion($artifactIds $Log4jReleaseVersion) +#end +#macro(mavenVersion $artifactIds $version) `pom.xml` ``` @@ -27,40 +30,49 @@ org.apache.logging.log4j ${artifactId} -${Log4jReleaseVersion} +${version} #end ``` #end #macro(ivy $artifactIds) +#ivyVersion($artifactIds $Log4jReleaseVersion) +#end +#macro(ivyVersion $artifactIds $version) `ivy.xml` ``` #foreach($artifactId in $artifactIds) - + #end ``` #end #macro(gradle $artifactIds) +#gradleVersion($artifactIds $Log4jReleaseVersion) +#end +#macro(gradleVersion $artifactIds $version) `build.gradle` ``` dependencies { #foreach($artifactId in $artifactIds) - compile group: 'org.apache.logging.log4j', name: '${artifactId}', version: '${Log4jReleaseVersion}' + compile group: 'org.apache.logging.log4j', name: '${artifactId}', version: '${version}' #end } ``` #end #macro(sbt $artifactIds) +#sbtVersion($artifactIds $Log4jReleaseVersion) +#end +#macro(sbtVersion $artifactIds $version) `build.sbt` ``` #foreach($artifactId in $artifactIds) -libraryDependencies += "org.apache.logging.log4j" %#if($artifactId.endsWith('scala'))%#end "${artifactId}" % "${Log4jReleaseVersion}" +libraryDependencies += "org.apache.logging.log4j" %#if($artifactId.endsWith('scala'))%#end "${artifactId}" % "${version}" #end ``` #end @@ -255,27 +267,27 @@ $h3 Scala API A convenient Scala wrapper for the Logger API. SBT users can add the following to their `build.sbt`: -#sbt(['log4j-api-scala']) +#sbtVersion(['log4j-api-scala'], '11.0') Maven, Ivy, and Gradle users need to add the Scala version to the artifact name. Scala 2.12 users can use the following: -#maven(['log4j-api-scala_2.12']) -#ivy(['log4j-api-scala_2.12']) -#gradle(['log4j-api-scala_2.12']) +#mavenVersion(['log4j-api-scala_2.12'], '11.0') +#ivyVersion(['log4j-api-scala_2.12'], '11.0') +#gradleVersion(['log4j-api-scala_2.12'], '11.0') Scala 2.11 users can use the following: -#maven(['log4j-api-scala_2.11']) -#ivy(['log4j-api-scala_2.11']) -#gradle(['log4j-api-scala_2.11']) +#mavenVersion(['log4j-api-scala_2.11'], '11.0') +#ivyVersion(['log4j-api-scala_2.11'], '11.0') +#gradleVersion(['log4j-api-scala_2.11'], '11.0') Scala 2.10 users can use the following: -#maven(['log4j-api-scala_2.10']) -#ivy(['log4j-api-scala_2.10']) -#gradle(['log4j-api-scala_2.10']) +#mavenVersion(['log4j-api-scala_2.10'], '11.0') +#ivyVersion(['log4j-api-scala_2.10'], '11.0') +#gradleVersion(['log4j-api-scala_2.10'], '11.0') $h2 Snapshot builds
logging-log4j2 git commit: Fix link to Scala API
Repository: logging-log4j2 Updated Branches: refs/heads/master a280ff914 -> fc098dd6e Fix link to Scala API Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/fc098dd6 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/fc098dd6 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/fc098dd6 Branch: refs/heads/master Commit: fc098dd6ec84c311177993c1ac11b7cf4f419345 Parents: a280ff9 Author: Mikael StåldalAuthored: Sat Nov 25 15:27:23 2017 +0100 Committer: Mikael Ståldal Committed: Sat Nov 25 15:27:23 2017 +0100 -- src/site/xdoc/runtime-dependencies.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/fc098dd6/src/site/xdoc/runtime-dependencies.xml -- diff --git a/src/site/xdoc/runtime-dependencies.xml b/src/site/xdoc/runtime-dependencies.xml index 1f66725..9429feb 100644 --- a/src/site/xdoc/runtime-dependencies.xml +++ b/src/site/xdoc/runtime-dependencies.xml @@ -404,7 +404,7 @@ log4j-api-scala -The Log4j Scala API requires Scala runtime library and reflection in +The Log4j Scala API requires Scala runtime library and reflection in addition to the Log4j API.
[1/4] logging-chainsaw git commit: Try to upgrade to Log4j 2
Repository: logging-chainsaw Updated Branches: refs/heads/log4j-2 [created] deb3b3c04 http://git-wip-us.apache.org/repos/asf/logging-chainsaw/blob/deb3b3c0/src/main/java/org/apache/log4j/spi/RendererSupport.java -- diff --git a/src/main/java/org/apache/log4j/spi/RendererSupport.java b/src/main/java/org/apache/log4j/spi/RendererSupport.java new file mode 100644 index 000..9d69faa --- /dev/null +++ b/src/main/java/org/apache/log4j/spi/RendererSupport.java @@ -0,0 +1,33 @@ +/* + * 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.log4j.spi; + +import org.apache.log4j.or.ObjectRenderer; +import org.apache.log4j.or.RendererMap; + + +public interface RendererSupport { + + public + RendererMap getRendererMap(); + + public + void setRenderer(Class renderedClass, ObjectRenderer renderer); + +} http://git-wip-us.apache.org/repos/asf/logging-chainsaw/blob/deb3b3c0/src/main/java/org/apache/log4j/spi/Thresholdable.java -- diff --git a/src/main/java/org/apache/log4j/spi/Thresholdable.java b/src/main/java/org/apache/log4j/spi/Thresholdable.java index 222345f..b85bfb2 100644 --- a/src/main/java/org/apache/log4j/spi/Thresholdable.java +++ b/src/main/java/org/apache/log4j/spi/Thresholdable.java @@ -17,7 +17,7 @@ package org.apache.log4j.spi; -import org.apache.log4j.Level; +import org.apache.logging.log4j.Level; /** * An interface that defines the required methods for supporting the @@ -32,7 +32,7 @@ import org.apache.log4j.Level; */ public interface Thresholdable { /** - * Sets the component theshold to the given level. + * Sets the component threshold to the given level. * * @param level The threshold level events must equal or be greater * than before further processing can be done. http://git-wip-us.apache.org/repos/asf/logging-chainsaw/blob/deb3b3c0/src/main/java/org/apache/log4j/varia/ListModelAppender.java -- diff --git a/src/main/java/org/apache/log4j/varia/ListModelAppender.java b/src/main/java/org/apache/log4j/varia/ListModelAppender.java index ccbc9be..55bea90 100644 --- a/src/main/java/org/apache/log4j/varia/ListModelAppender.java +++ b/src/main/java/org/apache/log4j/varia/ListModelAppender.java @@ -17,8 +17,8 @@ package org.apache.log4j.varia; -import org.apache.log4j.AppenderSkeleton; -import org.apache.log4j.spi.LoggingEvent; +import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.core.appender.AbstractAppender; import javax.swing.DefaultListModel; import javax.swing.ListModel; @@ -32,17 +32,17 @@ import javax.swing.ListModel; * @author Paul Smith (psm...@apache.org) * */ -public final class ListModelAppender extends AppenderSkeleton { +public final class ListModelAppender extends AbstractAppender { /** * Default list model. */ - private final DefaultListModel model = new DefaultListModel(); + private final DefaultListModel model = new DefaultListModel<>(); /** * Constructs a ListModelAppender. */ public ListModelAppender() { - super(true); +super("ListModelAppender", null, null); } /** * Returns a reference to the ListModel that contains all the LoggingEvents @@ -54,13 +54,11 @@ public final class ListModelAppender extends AppenderSkeleton { return model; } -/** {@inheritDoc} */ - protected void append(final LoggingEvent event) { + public void append(final LogEvent event) { model.addElement(event); } -/** {@inheritDoc} */ - public void close() { + public void stop() { clearModel(); } @@ -71,9 +69,4 @@ public final class ListModelAppender extends AppenderSkeleton { model.clear(); } -/** {@inheritDoc} */ - public boolean requiresLayout() { - return false; - } - } http://git-wip-us.apache.org/repos/asf/logging-chainsaw/blob/deb3b3c0/src/main/java/org/apache/log4j/xml/SAXErrorHandler.java -- diff --git
[2/4] logging-chainsaw git commit: Try to upgrade to Log4j 2
http://git-wip-us.apache.org/repos/asf/logging-chainsaw/blob/deb3b3c0/src/main/java/org/apache/log4j/helpers/UtilLoggingLevel.java -- diff --git a/src/main/java/org/apache/log4j/helpers/UtilLoggingLevel.java b/src/main/java/org/apache/log4j/helpers/UtilLoggingLevel.java index b15fbca..fe353eb 100644 --- a/src/main/java/org/apache/log4j/helpers/UtilLoggingLevel.java +++ b/src/main/java/org/apache/log4j/helpers/UtilLoggingLevel.java @@ -20,165 +20,85 @@ package org.apache.log4j.helpers; import java.util.ArrayList; import java.util.List; -import org.apache.log4j.Level; +import org.apache.logging.log4j.Level; /** * An extension of the Level class that provides support for java.util.logging * Levels. * - * * @author Scott Deboy (sde...@apache.org) */ - -public class UtilLoggingLevel extends Level { - -/** - * Serialization version id. - */ -private static final long serialVersionUID = 909301162611820211L; +public final class UtilLoggingLevel { /** * Numerical value for SEVERE. */ -public static final int SEVERE_INT = 22000; +private static final int SEVERE_INT = 22000; /** * Numerical value for WARNING. */ -public static final int WARNING_INT = 21000; +private static final int WARNING_INT = 21000; + +/** + * Numerical value for INFO. + */ +private static final int INFO_INT = 2; -//INFO level defined in parent as 2..no need to redefine here - /** * Numerical value for CONFIG. */ -public static final int CONFIG_INT = 14000; +private static final int CONFIG_INT = 14000; + /** * Numerical value for FINE. */ -public static final int FINE_INT = 13000; +private static final int FINE_INT = 13000; + /** * Numerical value for FINER. */ -public static final int FINER_INT = 12000; +private static final int FINER_INT = 12000; + /** * Numerical value for FINEST. */ -public static final int FINEST_INT = 11000; -/** - * Numerical value for UNKNOWN. - */ -public static final int UNKNOWN_INT = 1; +private static final int FINEST_INT = 11000; /** * SEVERE. */ -public static final UtilLoggingLevel SEVERE = -new UtilLoggingLevel(SEVERE_INT, "SEVERE", 0); +private static final Level SEVERE = +Level.forName("SEVERE", SEVERE_INT); /** * WARNING. */ -public static final UtilLoggingLevel WARNING = -new UtilLoggingLevel(WARNING_INT, "WARNING", 4); +private static final Level WARNING = +Level.forName("WARNING", WARNING_INT); /** * INFO. */ -//note: we've aligned the int values of the java.util.logging INFO level with log4j's level -public static final UtilLoggingLevel INFO = -new UtilLoggingLevel(INFO_INT, "INFO", 5); +private static final Level INFO = +Level.forName("INFO", INFO_INT); /** * CONFIG. */ -public static final UtilLoggingLevel CONFIG = -new UtilLoggingLevel(CONFIG_INT, "CONFIG", 6); +private static final Level CONFIG = +Level.forName("CONFIG", CONFIG_INT); /** * FINE. */ -public static final UtilLoggingLevel FINE = -new UtilLoggingLevel(FINE_INT, "FINE", 7); +private static final Level FINE = +Level.forName("FINE", FINE_INT); /** * FINER. */ -public static final UtilLoggingLevel FINER = -new UtilLoggingLevel(FINER_INT, "FINER", 8); +private static final Level FINER = +Level.forName("FINER", FINER_INT); /** * FINEST. */ -public static final UtilLoggingLevel FINEST = -new UtilLoggingLevel(FINEST_INT, "FINEST", 9); - -/** - * Create new instance. - * @param level numeric value for level. - * @param levelStr symbolic name for level. - * @param syslogEquivalent Equivalent syslog severity. - */ -protected UtilLoggingLevel(final int level, - final String levelStr, - final int syslogEquivalent) { -super(level, levelStr, syslogEquivalent); -} - -/** - * Convert an integer passed as argument to a level. If the - * conversion fails, then this method returns the specified default. - * @param val numeric value. - * @param defaultLevel level to be returned if no level matches - * numeric value. - * @return matching level or default level. - */ -public static UtilLoggingLevel toLevel(final int val, - final UtilLoggingLevel defaultLevel) { -switch (val) { -case SEVERE_INT: -return SEVERE; - -case WARNING_INT: -return WARNING; - -case INFO_INT: -return INFO;
logging-log4j2 git commit: Always delete temporary file created in test, before test also
Repository: logging-log4j2 Updated Branches: refs/heads/master 91190aa54 -> b118dc624 Always delete temporary file created in test, before test also Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/b118dc62 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/b118dc62 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/b118dc62 Branch: refs/heads/master Commit: b118dc624eed0b6638c6fbf292e4365c47f3ef76 Parents: 91190aa Author: Mikael StåldalAuthored: Sat Nov 18 21:35:46 2017 +0100 Committer: Mikael Ståldal Committed: Sat Nov 18 21:35:46 2017 +0100 -- .../org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b118dc62/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java -- diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java b/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java index a5a8e67..dae9f41 100644 --- a/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java +++ b/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java @@ -162,13 +162,15 @@ public class Log4j1ConfigurationFactoryTest { @Test public void testSystemProperties1() throws Exception { final String tempFileName = System.getProperty("java.io.tmpdir") + "/hadoop.log"; +final Path tempFilePath = new File(tempFileName).toPath(); +Files.deleteIfExists(tempFilePath); try { final Configuration configuration = getConfiguration("config-1.2/log4j-system-properties-1.properties"); final RollingFileAppender appender = configuration.getAppender("RFA"); System.out.println("expected: " + tempFileName + " Actual: " + appender.getFileName()); assertEquals(tempFileName, appender.getFileName()); } finally { -Files.deleteIfExists(new File(tempFileName).toPath()); +Files.deleteIfExists(tempFilePath); } }
logging-log4j2 git commit: LOG4J2-2108 Fix StructuredDataMessage XML format
Repository: logging-log4j2 Updated Branches: refs/heads/master 5d7f784b4 -> 91190aa54 LOG4J2-2108 Fix StructuredDataMessage XML format Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/91190aa5 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/91190aa5 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/91190aa5 Branch: refs/heads/master Commit: 91190aa54bf3c0b07bf767c9bb2eaa4e904a460c Parents: 5d7f784 Author: Mikael StåldalAuthored: Sat Nov 18 18:42:28 2017 +0100 Committer: Mikael Ståldal Committed: Sat Nov 18 18:42:28 2017 +0100 -- .../log4j/message/StructuredDataMessage.java| 26 +++ .../message/StructuredDataMessageTest.java | 33 2 files changed, 45 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/91190aa5/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java -- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java index acb95a0..97acf38 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java @@ -339,6 +339,10 @@ public class StructuredDataMessage extends MapMessage
logging-log4j2 git commit: Always delete temporary file created in test
Repository: logging-log4j2 Updated Branches: refs/heads/master e962f82cf -> 5d7f784b4 Always delete temporary file created in 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/5d7f784b Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/5d7f784b Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/5d7f784b Branch: refs/heads/master Commit: 5d7f784b4fecf086b545c2143a054c9ce5c9c301 Parents: e962f82 Author: Mikael StåldalAuthored: Sat Nov 18 12:59:08 2017 +0100 Committer: Mikael Ståldal Committed: Sat Nov 18 12:59:08 2017 +0100 -- .../log4j/config/Log4j1ConfigurationFactoryTest.java | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5d7f784b/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java -- diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java b/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java index ff1fa12..a5a8e67 100644 --- a/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java +++ b/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java @@ -161,12 +161,15 @@ public class Log4j1ConfigurationFactoryTest { @Test public void testSystemProperties1() throws Exception { - final Configuration configuration = getConfiguration("config-1.2/log4j-system-properties-1.properties"); - final RollingFileAppender appender = configuration.getAppender("RFA"); final String tempFileName = System.getProperty("java.io.tmpdir") + "/hadoop.log"; -System.out.println("expected: " + tempFileName + " Actual: " + appender.getFileName()); - assertEquals(tempFileName, appender.getFileName()); - Files.deleteIfExists(new File(tempFileName).toPath()); +try { +final Configuration configuration = getConfiguration("config-1.2/log4j-system-properties-1.properties"); +final RollingFileAppender appender = configuration.getAppender("RFA"); +System.out.println("expected: " + tempFileName + " Actual: " + appender.getFileName()); +assertEquals(tempFileName, appender.getFileName()); +} finally { +Files.deleteIfExists(new File(tempFileName).toPath()); +} } @Test
[3/4] logging-log4j2 git commit: LOG4J2-2120 Update changes.xml
LOG4J2-2120 Update changes.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/d563cb30 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d563cb30 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d563cb30 Branch: refs/heads/master Commit: d563cb3095397eb065c35e284f52cd187cb2b28d Parents: 11d6b5e Author: Mikael StåldalAuthored: Thu Nov 16 20:57:09 2017 +0100 Committer: Mikael Ståldal Committed: Thu Nov 16 20:57:09 2017 +0100 -- src/changes/changes.xml | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d563cb30/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 683a67c..2972991 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -31,6 +31,9 @@ - "remove" - Removed --> + +Properly escape newlines and other control characters in JSON. + Add property to disable message pattern converter lookups.
[1/4] logging-log4j2 git commit: LOG4J2-2120: Json escaping handles newline correctly
Repository: logging-log4j2 Updated Branches: refs/heads/master e5f6d6d86 -> 464ed9a82 LOG4J2-2120: Json escaping handles newline correctly Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d44f4527 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d44f4527 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d44f4527 Branch: refs/heads/master Commit: d44f4527747a24ea0037aba6fdfd16962ace35c3 Parents: e5f6d6d Author: Carter KozakAuthored: Wed Nov 15 17:30:26 2017 -0500 Committer: Mikael Ståldal Committed: Thu Nov 16 20:42:29 2017 +0100 -- .../org/apache/logging/log4j/util/StringBuilders.java | 6 +- .../org/apache/logging/log4j/message/MapMessageTest.java | 10 ++ .../log4j/core/pattern/EncodingPatternConverterTest.java | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d44f4527/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java -- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java index 5dc5dc1..a2a33ff 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java @@ -171,7 +171,11 @@ public final class StringBuilders { public static void escapeJson(final StringBuilder toAppendTo, final int start) { for (int i = toAppendTo.length() - 1; i >= start; i--) { // backwards: length may change final char c = toAppendTo.charAt(i); -if (Character.isISOControl(c)) { +if (c == '\n') { +// Json string newline character must be encoded as literal "\n" +toAppendTo.setCharAt(i, '\\'); +toAppendTo.insert(i + 1, 'n'); +} else if (Character.isISOControl(c)) { // all iso control characters are in U+00xx toAppendTo.setCharAt(i, '\\'); toAppendTo.insert(i + 1, "u"); http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d44f4527/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java -- diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java index a64e6bd..85bea2b 100644 --- a/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java +++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java @@ -94,6 +94,16 @@ public class MapMessageTest { } @Test +public void testJSONEscapeNewline() { +final String testMsg = "hello\nworld"; +final StringMapMessage msg = new StringMapMessage(); +msg.put("one\ntwo", testMsg); +final String result = msg.getFormattedMessage(new String[]{"JSON"}); +final String expected = "{\"one\\ntwo\":\"hello\\nworld\"}"; +assertEquals(expected, result); +} + +@Test public void testJava() { final String testMsg = "Test message {}"; final StringMapMessage msg = new StringMapMessage(); http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d44f4527/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverterTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverterTest.java index 7767fea..a6733c1 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverterTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverterTest.java @@ -54,9 +54,9 @@ public class EncodingPatternConverterTest { final LogEvent event = Log4jLogEvent.newBuilder() .setLoggerName(getClass().getName()) .setLevel(Level.DEBUG) -.setMessage(new SimpleMessage("This string contains \"quotes\" and \\ backslash and \u001F control")) +.setMessage(new SimpleMessage("This string contains \"quotes\" and \\ backslash and \u001F control and\nnewline")) .build(); -final String expected = "This string contains \\\"quotes\\\" and backslash and \\u001F control"; +final String expected = "This string contains \\\"quotes\\\" and
[2/4] logging-log4j2 git commit: Closes #133
Closes #133 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/11d6b5ed Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/11d6b5ed Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/11d6b5ed Branch: refs/heads/master Commit: 11d6b5ed3a70c0fc53e398a9cf24d6e251db5d21 Parents: d44f452 Author: Mikael StåldalAuthored: Thu Nov 16 20:42:37 2017 +0100 Committer: Mikael Ståldal Committed: Thu Nov 16 20:42:37 2017 +0100 -- --
[4/4] logging-log4j2 git commit: LOG4J2-2120 Properly escape all control characters in JSON
LOG4J2-2120 Properly escape all control characters in JSON Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/464ed9a8 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/464ed9a8 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/464ed9a8 Branch: refs/heads/master Commit: 464ed9a82646416821add6f5f07bf701db3b08a0 Parents: d563cb3 Author: Mikael StåldalAuthored: Thu Nov 16 21:03:32 2017 +0100 Committer: Mikael Ståldal Committed: Thu Nov 16 21:03:32 2017 +0100 -- .../logging/log4j/util/StringBuilders.java | 54 +++- .../logging/log4j/message/MapMessageTest.java | 7 +-- 2 files changed, 45 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/464ed9a8/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java -- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java index a2a33ff..a17d195 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java @@ -171,19 +171,47 @@ public final class StringBuilders { public static void escapeJson(final StringBuilder toAppendTo, final int start) { for (int i = toAppendTo.length() - 1; i >= start; i--) { // backwards: length may change final char c = toAppendTo.charAt(i); -if (c == '\n') { -// Json string newline character must be encoded as literal "\n" -toAppendTo.setCharAt(i, '\\'); -toAppendTo.insert(i + 1, 'n'); -} else if (Character.isISOControl(c)) { -// all iso control characters are in U+00xx -toAppendTo.setCharAt(i, '\\'); -toAppendTo.insert(i + 1, "u"); -toAppendTo.setCharAt(i + 4, Chars.getUpperCaseHex((c & 0xF0) >> 4)); -toAppendTo.setCharAt(i + 5, Chars.getUpperCaseHex(c & 0xF)); -} else if (c == '"' || c == '\\') { -// only " and \ need to be escaped; other escapes are optional -toAppendTo.insert(i, '\\'); +switch (c) { +case '\b': +toAppendTo.setCharAt(i, '\\'); +toAppendTo.insert(i + 1, 'b'); +break; + +case '\t': +toAppendTo.setCharAt(i, '\\'); +toAppendTo.insert(i + 1, 't'); +break; + +case '\f': +toAppendTo.setCharAt(i, '\\'); +toAppendTo.insert(i + 1, 'f'); +break; + +case '\n': +// Json string newline character must be encoded as literal "\n" +toAppendTo.setCharAt(i, '\\'); +toAppendTo.insert(i + 1, 'n'); +break; + +case '\r': +toAppendTo.setCharAt(i, '\\'); +toAppendTo.insert(i + 1, 'r'); +break; + +case '"': +case '\\': +// only " and \ need to be escaped; other escapes are optional +toAppendTo.insert(i, '\\'); +break; + +default: +if (Character.isISOControl(c)) { +// all iso control characters are in U+00xx +toAppendTo.setCharAt(i, '\\'); +toAppendTo.insert(i + 1, "u"); +toAppendTo.setCharAt(i + 4, Chars.getUpperCaseHex((c & 0xF0) >> 4)); +toAppendTo.setCharAt(i + 5, Chars.getUpperCaseHex(c & 0xF)); +} } } } http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/464ed9a8/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java -- diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java index 85bea2b..44a15aa 100644 --- a/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java +++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java @@ -94,12 +94,13 @@ public class MapMessageTest { } @Test -public void testJSONEscapeNewline() { -final String testMsg = "hello\nworld"; +public void
logging-log4j2 git commit: Closes #130
Repository: logging-log4j2 Updated Branches: refs/heads/master 3788900c8 -> e5f6d6d86 Closes #130 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/e5f6d6d8 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e5f6d6d8 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e5f6d6d8 Branch: refs/heads/master Commit: e5f6d6d86578be5beb7be2142439ae7e287018dd Parents: 3788900 Author: Mikael StåldalAuthored: Thu Nov 16 20:33:02 2017 +0100 Committer: Mikael Ståldal Committed: Thu Nov 16 20:33:02 2017 +0100 -- --
[1/2] logging-log4j2 git commit: ParameterFormatter.deepToString checks more special types
Repository: logging-log4j2 Updated Branches: refs/heads/master 27c8cec42 -> 3788900c8 ParameterFormatter.deepToString checks more special types This change allows us to avoid StringBuilder usage for primitives. Updated the StringBuilder codepath to efficiently append byte objects. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/aacd1eb0 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/aacd1eb0 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/aacd1eb0 Branch: refs/heads/master Commit: aacd1eb0eb3bd4cde8e7f454bf7248140c2abbce Parents: 27c8cec Author: Carter KozakAuthored: Wed Nov 15 11:54:05 2017 -0500 Committer: Mikael Ståldal Committed: Wed Nov 15 21:33:18 2017 +0100 -- .../log4j/message/ParameterFormatter.java | 25 .../logging/log4j/util/StringBuilders.java | 2 ++ 2 files changed, 27 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/aacd1eb0/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java -- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java index e506d89..29d7090 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java @@ -392,9 +392,34 @@ final class ParameterFormatter { if (o == null) { return null; } +// Check special types to avoid unnecessary StringBuilder usage if (o instanceof String) { return (String) o; } +if (o instanceof Integer) { +return Integer.toString((Integer) o); +} +if (o instanceof Long) { +return Long.toString((Long) o); +} +if (o instanceof Double) { +return Double.toString((Double) o); +} +if (o instanceof Boolean) { +return Boolean.toString((Boolean) o); +} +if (o instanceof Character) { +return Character.toString((Character) o); +} +if (o instanceof Short) { +return Short.toString((Short) o); +} +if (o instanceof Float) { +return Float.toString((Float) o); +} +if (o instanceof Byte) { +return Byte.toString((Byte) o); +} final StringBuilder str = new StringBuilder(); recursiveDeepToString(o, str, null); return str.toString(); http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/aacd1eb0/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java -- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java index c786e30..5dc5dc1 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java @@ -95,6 +95,8 @@ public final class StringBuilders { stringBuilder.append(((Short) obj).shortValue()); } else if (obj instanceof Float) { stringBuilder.append(((Float) obj).floatValue()); +} else if (obj instanceof Byte) { +stringBuilder.append(((Byte) obj).byteValue()); } else { return false; }
[2/2] logging-log4j2 git commit: Closes #132
Closes #132 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/3788900c Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/3788900c Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/3788900c Branch: refs/heads/master Commit: 3788900c8fda77c44455fa108dc25b24888bbe6e Parents: aacd1eb Author: Mikael StåldalAuthored: Wed Nov 15 21:33:39 2017 +0100 Committer: Mikael Ståldal Committed: Wed Nov 15 21:33:39 2017 +0100 -- --
[1/5] logging-log4j2 git commit: Add documentation for log4j.formatMsgNoLookups
Repository: logging-log4j2 Updated Branches: refs/heads/master d5c42930d -> 69ddd6f9f Add documentation for log4j.formatMsgNoLookups Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/37912a76 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/37912a76 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/37912a76 Branch: refs/heads/master Commit: 37912a7626fbec387ec54b87f4c9be768fe797c0 Parents: dd18e9b Author: Carter KozakAuthored: Sat Nov 11 17:59:41 2017 -0500 Committer: Mikael Ståldal Committed: Sun Nov 12 15:28:55 2017 +0100 -- src/site/xdoc/manual/configuration.xml.vm | 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/37912a76/src/site/xdoc/manual/configuration.xml.vm -- diff --git a/src/site/xdoc/manual/configuration.xml.vm b/src/site/xdoc/manual/configuration.xml.vm index 09e7ebc..e3042f4 100644 --- a/src/site/xdoc/manual/configuration.xml.vm +++ b/src/site/xdoc/manual/configuration.xml.vm @@ -2231,6 +2231,14 @@ public class AwesomeTest { Prints a stacktrace to the status logger at DEBUG level when the LoggerContext is started. For debug purposes. + + log4j.formatMsgNoLookups + FORMAT_MESSAGES_PATTERN_DISABLE_LOOKUPS + log4j.formatMsgNoLookups + false + Disables message pattern lookups globally when set to true. + This is equivalent to defining all message patterns using %m{nolookups}. +
[2/5] logging-log4j2 git commit: LOG4J2-2109: Added "log4j.formatMsgNoLookups" global configuration
LOG4J2-2109: Added "log4j.formatMsgNoLookups" global configuration This allows applications to globally disable message pattern from looking up replacements without specifying "%m{nolookups}". Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/dd18e9b2 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/dd18e9b2 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/dd18e9b2 Branch: refs/heads/master Commit: dd18e9b21009055e226daf5b233c92b6a17934ca Parents: d5c4293 Author: Carter KozakAuthored: Thu Nov 9 08:32:14 2017 -0500 Committer: Mikael Ståldal Committed: Sun Nov 12 15:28:55 2017 +0100 -- .../core/pattern/MessagePatternConverter.java | 3 +- .../logging/log4j/core/util/Constants.java | 9 + .../pattern/MessagePatternConverterTest.java| 41 3 files changed, 52 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/dd18e9b2/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/MessagePatternConverter.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/MessagePatternConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/MessagePatternConverter.java index 7b1d77e..92d75a2 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/MessagePatternConverter.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/MessagePatternConverter.java @@ -22,6 +22,7 @@ import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.config.Configuration; import org.apache.logging.log4j.core.config.plugins.Plugin; import org.apache.logging.log4j.core.util.ArrayUtils; +import org.apache.logging.log4j.core.util.Constants; import org.apache.logging.log4j.core.util.Loader; import org.apache.logging.log4j.message.Message; import org.apache.logging.log4j.message.MultiformatMessage; @@ -56,7 +57,7 @@ public final class MessagePatternConverter extends LogEventPatternConverter { this.formats = options; this.config = config; final int noLookupsIdx = loadNoLookups(options); -this.noLookups = noLookupsIdx >= 0; +this.noLookups = Constants.FORMAT_MESSAGES_PATTERN_DISABLE_LOOKUPS || noLookupsIdx >= 0; this.textRenderer = loadMessageRenderer(noLookupsIdx >= 0 ? ArrayUtils.remove(options, noLookupsIdx) : options); } http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/dd18e9b2/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Constants.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Constants.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Constants.java index aa8b74d..ef30491 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Constants.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Constants.java @@ -55,6 +55,15 @@ public final class Constants { "log4j.format.msg.async", false); /** + * LOG4J2-2109 if {@code true}, MessagePatternConverter will always operate as though + * %m{nolookups} is configured. + * + * @since 2.10 + */ +public static final boolean FORMAT_MESSAGES_PATTERN_DISABLE_LOOKUPS = PropertiesUtil.getProperties().getBooleanProperty( +"log4j.formatMsgNoLookups", false); + +/** * {@code true} if we think we are running in a web container, based on the boolean value of system property * "log4j2.is.webapp", or (if this system property is not set) whether the {@code javax.servlet.Servlet} class * is present in the classpath. http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/dd18e9b2/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java index 8a1fb0c..cd85071 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java @@ -17,12 +17,15 @@ package org.apache.logging.log4j.core.pattern; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.core.LogEvent;
[5/5] logging-log4j2 git commit: LOG4J2-2109 Fix configuration property name
LOG4J2-2109 Fix configuration property 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/69ddd6f9 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/69ddd6f9 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/69ddd6f9 Branch: refs/heads/master Commit: 69ddd6f9f64647ae33fb63e85d57acff66e1fd45 Parents: 163eafd Author: Mikael StåldalAuthored: Sun Nov 12 15:33:12 2017 +0100 Committer: Mikael Ståldal Committed: Sun Nov 12 15:33:12 2017 +0100 -- .../main/java/org/apache/logging/log4j/core/util/Constants.java | 2 +- src/site/xdoc/manual/configuration.xml.vm| 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/69ddd6f9/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Constants.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Constants.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Constants.java index ef30491..fa01c13 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Constants.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Constants.java @@ -61,7 +61,7 @@ public final class Constants { * @since 2.10 */ public static final boolean FORMAT_MESSAGES_PATTERN_DISABLE_LOOKUPS = PropertiesUtil.getProperties().getBooleanProperty( -"log4j.formatMsgNoLookups", false); +"log4j2.formatMsgNoLookups", false); /** * {@code true} if we think we are running in a web container, based on the boolean value of system property http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/69ddd6f9/src/site/xdoc/manual/configuration.xml.vm -- diff --git a/src/site/xdoc/manual/configuration.xml.vm b/src/site/xdoc/manual/configuration.xml.vm index e3042f4..3367d2c 100644 --- a/src/site/xdoc/manual/configuration.xml.vm +++ b/src/site/xdoc/manual/configuration.xml.vm @@ -2232,9 +2232,9 @@ public class AwesomeTest { when the LoggerContext is started. For debug purposes. - log4j.formatMsgNoLookups + log4j2.formatMsgNoLookups FORMAT_MESSAGES_PATTERN_DISABLE_LOOKUPS - log4j.formatMsgNoLookups + log4j2.formatMsgNoLookups false Disables message pattern lookups globally when set to true. This is equivalent to defining all message patterns using %m{nolookups}.
[3/5] logging-log4j2 git commit: Closes #127
Closes #127 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d3088bdc Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d3088bdc Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d3088bdc Branch: refs/heads/master Commit: d3088bdca57f24565cef64413a449f88bc649c6e Parents: 37912a7 Author: Mikael StåldalAuthored: Sun Nov 12 15:29:08 2017 +0100 Committer: Mikael Ståldal Committed: Sun Nov 12 15:29:08 2017 +0100 -- --
[4/5] logging-log4j2 git commit: LOG4J2-2109 Update changes.xml
LOG4J2-2109 Update changes.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/163eafd3 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/163eafd3 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/163eafd3 Branch: refs/heads/master Commit: 163eafd35f2e0a3422ce2ac97a7f385fa0cfb079 Parents: d3088bd Author: Mikael StåldalAuthored: Sun Nov 12 15:31:40 2017 +0100 Committer: Mikael Ståldal Committed: Sun Nov 12 15:31:40 2017 +0100 -- src/changes/changes.xml | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/163eafd3/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 17ca19d..69eb04b 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -31,6 +31,9 @@ - "remove" - Removed --> + +Add property to disable message pattern converter lookups. + MapMessage should use deep toString for values.
[05/12] logging-log4j2 git commit: LOG4J2-2102: MapMessage Json and XML encodings escape keys and values
LOG4J2-2102: MapMessage Json and XML encodings escape keys and values Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6757d397 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6757d397 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6757d397 Branch: refs/heads/master Commit: 6757d39783f62961fe9f520367799f8d6fb30bca Parents: f0123b1 Author: Carter KozakAuthored: Mon Nov 6 13:49:36 2017 -0500 Committer: Mikael Ståldal Committed: Sat Nov 11 22:08:09 2017 +0100 -- .../logging/log4j/message/MapMessage.java | 20 ++--- .../logging/log4j/util/StringBuilders.java | 44 .../logging/log4j/message/MapMessageTest.java | 21 ++ .../core/pattern/EncodingPatternConverter.java | 41 ++ 4 files changed, 83 insertions(+), 43 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6757d397/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java -- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java index 649772d..48f7ec7 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java @@ -21,6 +21,7 @@ import java.util.Map; import java.util.TreeMap; import org.apache.logging.log4j.util.BiConsumer; +import org.apache.logging.log4j.util.Chars; import org.apache.logging.log4j.util.EnglishEnums; import org.apache.logging.log4j.util.IndexedReadOnlyStringMap; import org.apache.logging.log4j.util.IndexedStringMap; @@ -344,9 +345,11 @@ public class MapMessage, V> implements MultiformatMes for (int i = 0; i < data.size(); i++) { sb.append(" ") -.append(data.getValueAt(i)) -.append("\n"); +.append("\">"); +int size = sb.length(); +sb.append(data.getValueAt(i)); +StringBuilders.escapeXml(sb, size); +sb.append("\n"); } sb.append(""); } @@ -400,8 +403,15 @@ public class MapMessage, V> implements MultiformatMes if (i > 0) { sb.append(", "); } -StringBuilders.appendDqValue(sb, data.getKeyAt(i)).append(':'); -StringBuilders.appendDqValue(sb, data.getValueAt(i)); +sb.append(Chars.DQUOTE); +int start = sb.length(); +sb.append(data.getKeyAt(i)); +StringBuilders.escapeJson(sb, start); +sb.append(Chars.DQUOTE).append(':').append(Chars.DQUOTE); +start = sb.length(); +sb.append(data.getValueAt(i)); +StringBuilders.escapeJson(sb, start); +sb.append(Chars.DQUOTE); } sb.append('}'); } http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6757d397/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java -- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java index 2d6ae9c..1ab0909 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java @@ -158,4 +158,48 @@ public final class StringBuilders { stringBuilder.trimToSize(); } } + +public static void escapeJson(final StringBuilder toAppendTo, final int start) { +for (int i = toAppendTo.length() - 1; i >= start; i--) { // backwards: length may change +final char c = toAppendTo.charAt(i); +if (Character.isISOControl(c)) { +// all iso control characters are in U+00xx +toAppendTo.setCharAt(i, '\\'); +toAppendTo.insert(i + 1, "u"); +toAppendTo.setCharAt(i + 4, Chars.getUpperCaseHex((c & 0xF0) >> 4)); +toAppendTo.setCharAt(i + 5, Chars.getUpperCaseHex(c & 0xF)); +} else if (c == '"' || c == '\\') { +// only " and \ need to be escaped; other escapes are optional +toAppendTo.insert(i, '\\'); +} +} +} + +public static void escapeXml(final StringBuilder toAppendTo, final int start) { +for (int i = toAppendTo.length() - 1; i >= start; i--) { // backwards: length may change +final char c = toAppendTo.charAt(i); +switch (c) { +
[09/12] logging-log4j2 git commit: Closes #126
Closes #126 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/876d6642 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/876d6642 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/876d6642 Branch: refs/heads/master Commit: 876d6642a5688c28dbb94af946d4a5f38f5e41fd Parents: 059cdb3 Author: Mikael StåldalAuthored: Sat Nov 11 22:09:07 2017 +0100 Committer: Mikael Ståldal Committed: Sat Nov 11 22:09:07 2017 +0100 -- --
[12/12] logging-log4j2 git commit: Fix MapMessageTest
Fix MapMessageTest Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a23a4859 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a23a4859 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a23a4859 Branch: refs/heads/master Commit: a23a48590e610cdf1dc2a4ef49e7a324809beed8 Parents: 2b93414 Author: Mikael StåldalAuthored: Sat Nov 11 22:31:37 2017 +0100 Committer: Mikael Ståldal Committed: Sat Nov 11 22:31:37 2017 +0100 -- .../logging/log4j/message/MapMessageTest.java | 23 +--- .../logging/log4j/message/ObjectMapMessage.java | 22 +++ 2 files changed, 32 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a23a4859/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java -- diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java index 61fda91..a64e6bd 100644 --- a/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java +++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java @@ -19,9 +19,6 @@ package org.apache.logging.log4j.message; import org.apache.logging.log4j.util.StringBuilderFormattable; import org.junit.Test; -import java.util.HashMap; -import java.util.Map; - import static org.junit.Assert.*; /** @@ -128,7 +125,7 @@ public class MapMessageTest { @Test public void testGetNonStringValue() { final String key = "Key"; -final MapMessage msg = new MapMessage<>() +final ObjectMapMessage msg = new ObjectMapMessage() .with(key, 1L); assertEquals("1", msg.get(key)); } @@ -136,14 +133,14 @@ public class MapMessageTest { @Test public void testRemoveNonStringValue() { final String key = "Key"; -final MapMessage msg = new MapMessage<>() +final ObjectMapMessage msg = new ObjectMapMessage() .with(key, 1L); assertEquals("1", msg.remove(key)); } @Test public void testJSONFormatNonStringValue() { -final MapMessage msg = new MapMessage<>() +final ObjectMapMessage msg = new ObjectMapMessage() .with("key", 1L); final String result = msg.getFormattedMessage(new String[]{"JSON"}); final String expected = "{\"key\":\"1\"}"; @@ -152,7 +149,7 @@ public class MapMessageTest { @Test public void testXMLFormatNonStringValue() { -final MapMessage msg = new MapMessage<>() +final ObjectMapMessage msg = new ObjectMapMessage() .with("key", 1L); final String result = msg.getFormattedMessage(new String[]{"XML"}); final String expected = "\n 1\n"; @@ -161,7 +158,7 @@ public class MapMessageTest { @Test public void testFormatToUsedInOutputXml() { -final MapMessage msg = new MapMessage<>() +final ObjectMapMessage msg = new ObjectMapMessage() .with("key", new FormattableTestType()); final String result = msg.getFormattedMessage(new String[]{"XML"}); final String expected = "\n formatTo\n"; @@ -170,7 +167,7 @@ public class MapMessageTest { @Test public void testFormatToUsedInOutputJson() { -final MapMessage msg = new MapMessage<>() +final ObjectMapMessage msg = new ObjectMapMessage() .with("key", new FormattableTestType()); final String result = msg.getFormattedMessage(new String[]{"JSON"}); final String expected = "{\"key\":\"formatTo\"}"; @@ -179,7 +176,7 @@ public class MapMessageTest { @Test public void testFormatToUsedInOutputJava() { -final MapMessage msg = new MapMessage<>() +final ObjectMapMessage msg = new ObjectMapMessage() .with("key", new FormattableTestType()); final String result = msg.getFormattedMessage(new String[]{"JAVA"}); final String expected = "{key=\"formatTo\"}"; @@ -188,7 +185,7 @@ public class MapMessageTest { @Test public void testFormatToUsedInOutputDefault() { -final MapMessage msg = new MapMessage<>() +final ObjectMapMessage msg = new ObjectMapMessage() .with("key", new FormattableTestType()); final String result = msg.getFormattedMessage(null); final String expected = "key=\"formatTo\""; @@ -198,7 +195,7 @@ public class MapMessageTest { @Test public void testGetUsesDeepToString() { final String key = "key"; -final MapMessage msg = new MapMessage<>() +
[06/12] logging-log4j2 git commit: Closes #129
Closes #129 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/c6373fbb Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/c6373fbb Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/c6373fbb Branch: refs/heads/master Commit: c6373fbbed6842254c8aa7bc5d46dea6ea574d35 Parents: 99287e8 Author: Mikael StåldalAuthored: Sat Nov 11 22:08:32 2017 +0100 Committer: Mikael Ståldal Committed: Sat Nov 11 22:08:32 2017 +0100 -- --
[11/12] logging-log4j2 git commit: Merge remote-tracking branch 'origin/master'
Merge remote-tracking branch 'origin/master' Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/2b93414a Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/2b93414a Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/2b93414a Branch: refs/heads/master Commit: 2b93414a403c21003774f7b0a8f92f143b5fec3c Parents: cadb81f c61f37d Author: Mikael StåldalAuthored: Sat Nov 11 22:17:35 2017 +0100 Committer: Mikael Ståldal Committed: Sat Nov 11 22:17:35 2017 +0100 -- .../org/apache/logging/log4j/appserver/jetty/Log4j2Logger.java | 2 ++ .../org/apache/logging/log4j/appserver/tomcat/TomcatLogger.java| 2 ++ 2 files changed, 4 insertions(+) --
[02/12] logging-log4j2 git commit: LOG4J2-2101: MapMessage correctly handles non-string map values
LOG4J2-2101: MapMessage correctly handles non-string map values Previously formatting non-string values worked, however filtering, which uess the "get" method would fail due to MapMessage attempting to cast values to String. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f0123b1d Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f0123b1d Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f0123b1d Branch: refs/heads/master Commit: f0123b1ddf236c2d1c0b23f005d0cf4f8e9dd6c5 Parents: 23bcd25 Author: Carter KozakAuthored: Mon Nov 6 13:14:36 2017 -0500 Committer: Mikael Ståldal Committed: Sat Nov 11 22:08:09 2017 +0100 -- .../logging/log4j/message/MapMessage.java | 15 +--- .../logging/log4j/message/MapMessageTest.java | 37 2 files changed, 48 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f0123b1d/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java -- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java index e39774c..649772d 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java @@ -200,7 +200,7 @@ public class MapMessage, V> implements MultiformatMes * @param map The Map to add. */ public void putAll(final Map map) { -for (final Map.Entry entry : map.entrySet()) { +for (final Map.Entry entry : map.entrySet()) { data.putValue(entry.getKey(), entry.getValue()); } } @@ -211,7 +211,11 @@ public class MapMessage, V> implements MultiformatMes * @return The value of the element or null if the key is not present. */ public String get(final String key) { -return data.getValue(key); +Object result = data.getValue(key); +if (result == null) { +return null; +} +return String.valueOf(result); } /** @@ -220,7 +224,7 @@ public class MapMessage, V> implements MultiformatMes * @return The previous value of the element. */ public String remove(final String key) { -final String result = data.getValue(key); +final String result = get(key); data.remove(key); return result; } @@ -338,7 +342,10 @@ public class MapMessage, V> implements MultiformatMes public void asXml(final StringBuilder sb) { sb.append("\n"); for (int i = 0; i < data.size(); i++) { -sb.append(" ").append((String)data.getValueAt(i)) +sb.append(" ") +.append(data.getValueAt(i)) .append("\n"); } sb.append(""); http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f0123b1d/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java -- diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java index 1e06914..9aae448 100644 --- a/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java +++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java @@ -18,6 +18,9 @@ package org.apache.logging.log4j.message; import org.junit.Test; +import java.util.HashMap; +import java.util.Map; + import static org.junit.Assert.*; /** @@ -99,4 +102,38 @@ public class MapMessageTest { final String expected2 = "{key1=\"value1\", key2=\"value2\", key3=\"value3\"}"; assertEquals(expected2, result2); } + +@Test +public void testGetNonStringValue() { +final String key = "Key"; +final MapMessage msg = new MapMessage<>() +.with(key, 1L); +assertEquals("1", msg.get(key)); +} + +@Test +public void testRemoveNonStringValue() { +final String key = "Key"; +final MapMessage msg = new MapMessage<>() +.with(key, 1L); +assertEquals("1", msg.remove(key)); +} + +@Test +public void testJSONFormatNonStringValue() { +final MapMessage msg = new MapMessage<>() +.with("key", 1L); +final String result = msg.getFormattedMessage(new String[]{"JSON"}); +final String expected = "{\"key\":\"1\"}"; +assertEquals(expected, result); +} + +@Test +public
[08/12] logging-log4j2 git commit: Closes #125
Closes #125 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/059cdb37 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/059cdb37 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/059cdb37 Branch: refs/heads/master Commit: 059cdb3725813912a2ab7a0c11a90a03021c047e Parents: f979609 Author: Mikael StåldalAuthored: Sat Nov 11 22:09:05 2017 +0100 Committer: Mikael Ståldal Committed: Sat Nov 11 22:09:05 2017 +0100 -- --
[10/12] logging-log4j2 git commit: Update changes.xml
Update changes.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/cadb81fc Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/cadb81fc Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/cadb81fc Branch: refs/heads/master Commit: cadb81fc56f31f1fc4aa081e1dfa33d3ce61bd72 Parents: 876d664 Author: Mikael StåldalAuthored: Sat Nov 11 22:17:29 2017 +0100 Committer: Mikael Ståldal Committed: Sat Nov 11 22:17:29 2017 +0100 -- src/changes/changes.xml | 12 1 file changed, 12 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/cadb81fc/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 184432b..17ca19d 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -31,6 +31,18 @@ - "remove" - Removed --> + +MapMessage should use deep toString for values. + + +MapMessage supports both StringBuilderFormattable and MultiformatMessage. + + +MapMessage JSON encoding will escape keys and values. + + +Non-string value in MapMessage caused ClassCastException. + Reduce locking when checking for rollover.
[07/12] logging-log4j2 git commit: Closes #124
Closes #124 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f9796095 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f9796095 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f9796095 Branch: refs/heads/master Commit: f979609546bbf1b5e259d7dfe69d3e73cdc66c4b Parents: c6373fb Author: Mikael StåldalAuthored: Sat Nov 11 22:09:02 2017 +0100 Committer: Mikael Ståldal Committed: Sat Nov 11 22:09:02 2017 +0100 -- --
[04/12] logging-log4j2 git commit: LOG4J2-2107: MapMessage allocation-free pattern conversion
LOG4J2-2107: MapMessage allocation-free pattern conversion Fixes an issue causing MessagePatternConverter to greedily format MapMessage instances as StringBuilderFormattable ignoring format. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/93a7235d Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/93a7235d Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/93a7235d Branch: refs/heads/master Commit: 93a7235da78c562026993cdc4e3e5775c47e8099 Parents: 6757d39 Author: Carter KozakAuthored: Wed Nov 8 16:53:31 2017 -0500 Committer: Mikael Ståldal Committed: Sat Nov 11 22:08:09 2017 +0100 -- .../logging/log4j/message/MapMessage.java | 22 +++-- .../MultiFormatStringBuilderFormattable.java| 25 .../core/pattern/MessagePatternConverter.java | 8 +-- 3 files changed, 46 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/93a7235d/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java -- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java index 48f7ec7..57894b8 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java @@ -25,10 +25,10 @@ import org.apache.logging.log4j.util.Chars; import org.apache.logging.log4j.util.EnglishEnums; import org.apache.logging.log4j.util.IndexedReadOnlyStringMap; import org.apache.logging.log4j.util.IndexedStringMap; +import org.apache.logging.log4j.util.MultiFormatStringBuilderFormattable; import org.apache.logging.log4j.util.PerformanceSensitive; import org.apache.logging.log4j.util.ReadOnlyStringMap; import org.apache.logging.log4j.util.SortedArrayStringMap; -import org.apache.logging.log4j.util.StringBuilderFormattable; import org.apache.logging.log4j.util.StringBuilders; import org.apache.logging.log4j.util.Strings; import org.apache.logging.log4j.util.TriConsumer; @@ -49,9 +49,9 @@ import org.apache.logging.log4j.util.TriConsumer; */ @PerformanceSensitive("allocation") @AsynchronouslyFormattable -public class MapMessage, V> implements MultiformatMessage, StringBuilderFormattable { +public class MapMessage, V> implements MultiFormatStringBuilderFormattable { -private static final long serialVersionUID = -5031471831131487120L; +private static final long serialVersionUID = -5031471831131487120L; /** * When set as the format specifier causes the Map to be formatted as XML. @@ -375,17 +375,20 @@ public class MapMessage, V> implements MultiformatMes */ @Override public String getFormattedMessage(final String[] formats) { +return format(getFormat(formats), new StringBuilder()).toString(); +} + +private MapFormat getFormat(final String[] formats) { if (formats == null || formats.length == 0) { -return asString(); +return null; } for (int i = 0; i < formats.length; i++) { final MapFormat mapFormat = MapFormat.lookupIgnoreCase(formats[i]); if (mapFormat != null) { -return format(mapFormat, new StringBuilder()).toString(); +return mapFormat; } } -return asString(); - +return null; } protected void appendMap(final StringBuilder sb) { @@ -449,6 +452,11 @@ public class MapMessage, V> implements MultiformatMes } @Override +public void formatTo(String[] formats, StringBuilder buffer) { +format(getFormat(formats), buffer); +} + +@Override public boolean equals(final Object o) { if (this == o) { return true; http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/93a7235d/log4j-api/src/main/java/org/apache/logging/log4j/util/MultiFormatStringBuilderFormattable.java -- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/MultiFormatStringBuilderFormattable.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/MultiFormatStringBuilderFormattable.java new file mode 100644 index 000..4b7cb3e --- /dev/null +++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/MultiFormatStringBuilderFormattable.java @@ -0,0 +1,25 @@ +package org.apache.logging.log4j.util; + +import org.apache.logging.log4j.message.MultiformatMessage; + +/** + * A Message that can render itself in more than one way. The format string is used by the + * Message
[03/12] logging-log4j2 git commit: StructuredDataMessage implements MultiFormatStringBuilderFormattable
StructuredDataMessage implements MultiFormatStringBuilderFormattable Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/16c0b7ec Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/16c0b7ec Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/16c0b7ec Branch: refs/heads/master Commit: 16c0b7ecfd3d5702bfe38fc75951adc200b62158 Parents: 93a7235 Author: Carter KozakAuthored: Wed Nov 8 17:08:22 2017 -0500 Committer: Mikael Ståldal Committed: Sat Nov 11 22:08:09 2017 +0100 -- .../log4j/message/StructuredDataMessage.java| 21 +-- .../pattern/MessagePatternConverterTest.java| 58 2 files changed, 73 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/16c0b7ec/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java -- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java index 74a4542..acb95a0 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java @@ -20,7 +20,7 @@ package org.apache.logging.log4j.message; import java.util.Map; import org.apache.logging.log4j.util.EnglishEnums; -import org.apache.logging.log4j.util.StringBuilderFormattable; +import org.apache.logging.log4j.util.MultiFormatStringBuilderFormattable; import org.apache.logging.log4j.util.StringBuilders; /** @@ -35,7 +35,7 @@ import org.apache.logging.log4j.util.StringBuilders; * @see https://tools.ietf.org/html/rfc5424;>RFC 5424 */ @AsynchronouslyFormattable -public class StructuredDataMessage extends MapMessage implements StringBuilderFormattable { +public class StructuredDataMessage extends MapMessage implements MultiFormatStringBuilderFormattable { private static final long serialVersionUID = 1703221292892071920L; private static final int MAX_LENGTH = 32; @@ -253,6 +253,11 @@ public class StructuredDataMessage extends MapMessage 0) { for (int i = 0; i < formats.length; i++) { final String format = formats[i]; if (Format.XML.name().equalsIgnoreCase(format)) { -return asXml(); +return Format.XML; } else if (Format.FULL.name().equalsIgnoreCase(format)) { -return asString(Format.FULL, null); +return Format.FULL; } } -return asString(null, null); +return null; } -return asString(Format.FULL, null); +return Format.FULL; } private String asXml() { http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/16c0b7ec/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java index 2d5a5be..8a1fb0c 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/MessagePatternConverterTest.java @@ -26,6 +26,8 @@ import org.apache.logging.log4j.core.impl.Log4jLogEvent; import org.apache.logging.log4j.message.Message; import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.logging.log4j.message.SimpleMessage; +import org.apache.logging.log4j.message.StringMapMessage; +import org.apache.logging.log4j.message.StructuredDataMessage; import org.junit.Test; /** @@ -102,4 +104,60 @@ public class MessagePatternConverterTest {
[01/12] logging-log4j2 git commit: LOG4J2-2112: MapMessage values use deep toString
Repository: logging-log4j2 Updated Branches: refs/heads/master c61f37d7d -> a23a48590 LOG4J2-2112: MapMessage values use deep toString This allows for more efficient StringBuilder usage and usage of StringBuilderFormattable MapMessage values. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/99287e87 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/99287e87 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/99287e87 Branch: refs/heads/master Commit: 99287e87b6fb824526fc040f3fa240974f9754f1 Parents: 16c0b7e Author: Carter KozakAuthored: Thu Nov 9 11:36:01 2017 -0500 Committer: Mikael Ståldal Committed: Sat Nov 11 22:08:09 2017 +0100 -- .../logging/log4j/message/MapMessage.java | 17 ++--- .../log4j/message/ParameterFormatter.java | 39 ++- .../log4j/message/ReusableObjectMessage.java| 25 +-- .../logging/log4j/util/StringBuilders.java | 9 ++- .../logging/log4j/message/MapMessageTest.java | 70 5 files changed, 93 insertions(+), 67 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/99287e87/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java -- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java index 57894b8..9f2aeeb 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java @@ -213,10 +213,7 @@ public class MapMessage, V> implements MultiFormatStr */ public String get(final String key) { Object result = data.getValue(key); -if (result == null) { -return null; -} -return String.valueOf(result); +return ParameterFormatter.deepToString(result); } /** @@ -347,7 +344,7 @@ public class MapMessage, V> implements MultiFormatStr .append(data.getKeyAt(i)) .append("\">"); int size = sb.length(); -sb.append(data.getValueAt(i)); +ParameterFormatter.recursiveDeepToString(data.getValueAt(i), sb, null); StringBuilders.escapeXml(sb, size); sb.append("\n"); } @@ -396,7 +393,9 @@ public class MapMessage, V> implements MultiFormatStr if (i > 0) { sb.append(' '); } -StringBuilders.appendKeyDqValue(sb, data.getKeyAt(i), data.getValueAt(i)); +sb.append(data.getKeyAt(i)).append(Chars.EQ).append(Chars.DQUOTE); +ParameterFormatter.recursiveDeepToString(data.getValueAt(i), sb, null); +sb.append(Chars.DQUOTE); } } @@ -412,7 +411,7 @@ public class MapMessage, V> implements MultiFormatStr StringBuilders.escapeJson(sb, start); sb.append(Chars.DQUOTE).append(':').append(Chars.DQUOTE); start = sb.length(); -sb.append(data.getValueAt(i)); +ParameterFormatter.recursiveDeepToString(data.getValueAt(i), sb, null); StringBuilders.escapeJson(sb, start); sb.append(Chars.DQUOTE); } @@ -426,7 +425,9 @@ public class MapMessage, V> implements MultiFormatStr if (i > 0) { sb.append(", "); } -StringBuilders.appendKeyDqValue(sb, data.getKeyAt(i), data.getValueAt(i)); +sb.append(data.getKeyAt(i)).append(Chars.EQ).append(Chars.DQUOTE); +ParameterFormatter.recursiveDeepToString(data.getValueAt(i), sb, null); +sb.append(Chars.DQUOTE); } sb.append('}'); } http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/99287e87/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java -- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java index 79c447a..e506d89 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java @@ -25,6 +25,7 @@ import java.util.Map; import java.util.Set; import org.apache.logging.log4j.util.StringBuilderFormattable; +import org.apache.logging.log4j.util.StringBuilders; /** * Supports parameter formatting as used in ParameterizedMessage and ReusableParameterizedMessage. @@ -395,8 +396,7 @@ final
[1/2] logging-log4j2 git commit: Modify MapMessage constructor
Repository: logging-log4j2 Updated Branches: refs/heads/master 70a67801d -> 51257fa4a Modify MapMessage constructor Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/460852ef Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/460852ef Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/460852ef Branch: refs/heads/master Commit: 460852ef961d5df296a6b028338fdc2cb4800b5c Parents: 70a6780 Author: liyao01 Authored: Mon Nov 6 10:38:45 2017 +0800 Committer: Mikael StåldalCommitted: Mon Nov 6 21:37:58 2017 +0100 -- .../main/java/org/apache/logging/log4j/message/MapMessage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/460852ef/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java -- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java index 5ca4971..e39774c 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java @@ -95,7 +95,7 @@ public class MapMessage, V> implements MultiformatMes * Constructs a new instance. */ public MapMessage() { -data = new SortedArrayStringMap(); +this.data = new SortedArrayStringMap(); } /** @@ -104,7 +104,7 @@ public class MapMessage, V> implements MultiformatMes * @param initialCapacity the initial capacity. */ public MapMessage(final int initialCapacity) { -data = new SortedArrayStringMap(initialCapacity); +this.data = new SortedArrayStringMap(initialCapacity); } /**
[2/2] logging-log4j2 git commit: Closes #123
Closes #123 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/51257fa4 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/51257fa4 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/51257fa4 Branch: refs/heads/master Commit: 51257fa4a46c7ce381e4795df310b344951e1bfb Parents: 460852e Author: Mikael StåldalAuthored: Mon Nov 6 21:38:08 2017 +0100 Committer: Mikael Ståldal Committed: Mon Nov 6 21:38:08 2017 +0100 -- --
[2/3] logging-log4j2 git commit: LOG4J2-1203 Update changes.xml
LOG4J2-1203 Update changes.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/d723a7fc Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d723a7fc Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d723a7fc Branch: refs/heads/master Commit: d723a7fc5a535481bef4afed3d00d61a7e8ebdc6 Parents: 6b41f58 Author: Mikael StåldalAuthored: Sun Nov 5 15:59:15 2017 +0100 Committer: Mikael Ståldal Committed: Sun Nov 5 15:59:15 2017 +0100 -- src/changes/changes.xml | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d723a7fc/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index a2e8686..24dd3d5 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -31,6 +31,9 @@ - "remove" - Removed --> + +Allow filtering of line breaks in layout pattern. + Add a noop AppenderSkeleton for applications still using Log4j 1.x.
[1/3] logging-log4j2 git commit: LOG4J2-1203 Added Pattern encoding for CRLF only
Repository: logging-log4j2 Updated Branches: refs/heads/master d8aa6de4a -> 85bf1bf07 LOG4J2-1203 Added Pattern encoding for CRLF only Added a Pattern encoding format limited to just CRLF for use cases where you do not want full HTML or JSON encoding, but do want to protected against CR and/or LF injection attacks in logs. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6b41f589 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6b41f589 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6b41f589 Branch: refs/heads/master Commit: 6b41f589781e8cdcaee0fac72ff4b75f538d89a6 Parents: d8aa6de Author: Robert TurnerAuthored: Wed Nov 1 20:53:24 2017 -0400 Committer: Mikael Ståldal Committed: Sun Nov 5 15:56:22 2017 +0100 -- .../core/pattern/EncodingPatternConverter.java | 19 +++ .../pattern/EncodingPatternConverterTest.java| 19 +++ src/site/xdoc/manual/layouts.xml.vm | 15 +-- 3 files changed, 51 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6b41f589/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverter.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverter.java index 38605ea..9897e9d 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverter.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverter.java @@ -153,6 +153,25 @@ public final class EncodingPatternConverter extends LogEventPatternConverter { } } } +}, + +CRLF { +@Override +void escape(final StringBuilder toAppendTo, final int start) { +for (int i = toAppendTo.length() - 1; i >= start; i--) { // backwards: length may change +final char c = toAppendTo.charAt(i); +switch (c) { +case '\r': +toAppendTo.setCharAt(i, '\\'); +toAppendTo.insert(i + 1, 'r'); +break; +case '\n': +toAppendTo.setCharAt(i, '\\'); +toAppendTo.insert(i + 1, 'n'); +break; +} +} +} }; /** http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6b41f589/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverterTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverterTest.java index 0e4136a..57ecbb0 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverterTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/EncodingPatternConverterTest.java @@ -67,4 +67,23 @@ public class EncodingPatternConverterTest { assertEquals(expected, sb.toString()); } + +@Test +public void testCrlfEscaping() { +final LogEvent event = Log4jLogEvent.newBuilder() // +.setLoggerName(EncodingPatternConverterTest.class.getName()) // +.setLevel(Level.DEBUG) // +.setMessage(new SimpleMessage("Test \r\nthis\r & \nthat")) +.build(); +final StringBuilder sb = new StringBuilder(); +final LoggerContext ctx = LoggerContext.getContext(); +final String[] options = new String[]{"%msg", "CRLF"}; +final EncodingPatternConverter converter = EncodingPatternConverter +.newInstance(ctx.getConfiguration(), options); +assertNotNull("Error creating converter", converter); +converter.format(event, sb); +assertEquals( +"Test \\r\\nthis\\r & \\nthat", +sb.toString()); +} } http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6b41f589/src/site/xdoc/manual/layouts.xml.vm -- diff --git a/src/site/xdoc/manual/layouts.xml.vm b/src/site/xdoc/manual/layouts.xml.vm index 1e8cfb3..9d4cd31 100644 --- a/src/site/xdoc/manual/layouts.xml.vm +++ b/src/site/xdoc/manual/layouts.xml.vm @@ -780,8 +780,8
[3/3] logging-log4j2 git commit: Closes #122
Closes #122 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/85bf1bf0 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/85bf1bf0 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/85bf1bf0 Branch: refs/heads/master Commit: 85bf1bf07a5f5c49a427b6953448da5ad98c7ddc Parents: d723a7f Author: Mikael StåldalAuthored: Sun Nov 5 15:59:31 2017 +0100 Committer: Mikael Ståldal Committed: Sun Nov 5 15:59:31 2017 +0100 -- --
logging-log4j2 git commit: Closes #121
Repository: logging-log4j2 Updated Branches: refs/heads/master d64be675f -> ee7162886 Closes #121 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/ee716288 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/ee716288 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/ee716288 Branch: refs/heads/master Commit: ee71628868326caad9dd974028058b4efcac7afd Parents: d64be67 Author: Mikael StåldalAuthored: Mon Oct 30 22:13:49 2017 +0100 Committer: Mikael Ståldal Committed: Mon Oct 30 22:13:49 2017 +0100 -- --
logging-log4j2 git commit: LOG4J2-2091 Fix test
Repository: logging-log4j2 Updated Branches: refs/heads/master e0260a7c9 -> d64be675f LOG4J2-2091 Fix 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/d64be675 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d64be675 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d64be675 Branch: refs/heads/master Commit: d64be675f06b720da425f1c457ba26e9d7d311d9 Parents: e0260a7 Author: Mikael StåldalAuthored: Sun Oct 29 20:41:45 2017 +0100 Committer: Mikael Ståldal Committed: Sun Oct 29 20:41:45 2017 +0100 -- .../log4j/core/util/ShutdownCallbackRegistryTest.java| 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d64be675/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ShutdownCallbackRegistryTest.java -- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ShutdownCallbackRegistryTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ShutdownCallbackRegistryTest.java index 433783e..4a86d12 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ShutdownCallbackRegistryTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ShutdownCallbackRegistryTest.java @@ -26,6 +26,7 @@ import org.apache.logging.log4j.core.impl.Log4jContextFactory; import org.apache.logging.log4j.core.selector.ContextSelector; import org.apache.logging.log4j.junit.LoggerContextRule; import org.apache.logging.log4j.status.StatusLogger; +import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; @@ -42,9 +43,16 @@ public class ShutdownCallbackRegistryTest { @BeforeClass public static void setUpClass() throws Exception { +System.setProperty("log4j2.is.webapp", "false"); System.setProperty(ShutdownCallbackRegistry.SHUTDOWN_CALLBACK_REGISTRY, Registry.class.getName()); } +@AfterClass +public static void afterClass() { + System.clearProperty(ShutdownCallbackRegistry.SHUTDOWN_CALLBACK_REGISTRY); +System.clearProperty("log4j2.is.webapp"); +} + @Test public void testShutdownCallbackRegistry() throws Exception { final LoggerContext context = ctx.getLoggerContext();
[2/3] logging-log4j2 git commit: Closes #120
Closes #120 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/fee2043f Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/fee2043f Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/fee2043f Branch: refs/heads/master Commit: fee2043f8021a72bd4f38cfb0b8db7a5f2da3f77 Parents: b59819e Author: Mikael StåldalAuthored: Sun Oct 29 19:33:57 2017 +0100 Committer: Mikael Ståldal Committed: Sun Oct 29 19:33:57 2017 +0100 -- --
[1/3] logging-log4j2 git commit: LOG4J2-2091: Respect the configured "log4j2.is.webapp" property
Repository: logging-log4j2 Updated Branches: refs/heads/master b50a23787 -> e0260a7c9 LOG4J2-2091: Respect the configured "log4j2.is.webapp" property Some applications run embedded servlet containers sharing a single logging context from the root application. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/b59819e4 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/b59819e4 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/b59819e4 Branch: refs/heads/master Commit: b59819e47c06d9e928df7e90bdb75189fd9ce306 Parents: b50a237 Author: Carter KozakAuthored: Thu Oct 26 11:02:28 2017 -0400 Committer: Mikael Ståldal Committed: Sun Oct 29 19:32:27 2017 +0100 -- .../log4j/core/impl/Log4jContextFactory.java| 10 +++-- .../logging/log4j/core/lookup/Interpolator.java | 3 +- .../main/resources/log4j2.component.properties | 16 .../apache/logging/log4j/web/PropertyTest.java | 43 .../logging/log4j/web/ShutdownPropertyTest.java | 33 --- 5 files changed, 52 insertions(+), 53 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b59819e4/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java index f7b4a83..bfd6df2 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java @@ -46,7 +46,8 @@ public class Log4jContextFactory implements LoggerContextFactory, ShutdownCallba private static final StatusLogger LOGGER = StatusLogger.getLogger(); private static final boolean SHUTDOWN_HOOK_ENABLED = - PropertiesUtil.getProperties().getBooleanProperty(ShutdownCallbackRegistry.SHUTDOWN_HOOK_ENABLED, true); + PropertiesUtil.getProperties().getBooleanProperty(ShutdownCallbackRegistry.SHUTDOWN_HOOK_ENABLED, true) && +!Constants.IS_WEB_APP; private final ContextSelector selector; private final ShutdownCallbackRegistry shutdownCallbackRegistry; @@ -120,7 +121,7 @@ public class Log4jContextFactory implements LoggerContextFactory, ShutdownCallba } private void initializeShutdownCallbackRegistry() { -if (SHUTDOWN_HOOK_ENABLED && this.shutdownCallbackRegistry instanceof LifeCycle) { +if (isShutdownHookEnabled() && this.shutdownCallbackRegistry instanceof LifeCycle) { try { ((LifeCycle) this.shutdownCallbackRegistry).start(); } catch (final IllegalStateException e) { @@ -314,7 +315,10 @@ public class Log4jContextFactory implements LoggerContextFactory, ShutdownCallba @Override public Cancellable addShutdownCallback(final Runnable callback) { -return SHUTDOWN_HOOK_ENABLED ? shutdownCallbackRegistry.addShutdownCallback(callback) : null; +return isShutdownHookEnabled() ? shutdownCallbackRegistry.addShutdownCallback(callback) : null; } +public boolean isShutdownHookEnabled() { +return SHUTDOWN_HOOK_ENABLED; +} } http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b59819e4/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java index 5259237..84b5e7a 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java @@ -29,6 +29,7 @@ import org.apache.logging.log4j.core.config.plugins.util.PluginType; import org.apache.logging.log4j.core.util.Loader; import org.apache.logging.log4j.core.util.ReflectionUtil; import org.apache.logging.log4j.status.StatusLogger; +import org.apache.logging.log4j.util.Constants; /** * Proxies all the other {@link StrLookup}s. @@ -115,7 +116,7 @@ public class Interpolator extends AbstractConfigurationAwareLookup { } lookups.put("date", new DateLookup()); lookups.put("ctx", new ContextMapLookup()); -if (Loader.isClassAvailable("javax.servlet.ServletContext")) { +if (Constants.IS_WEB_APP) { try { lookups.put(LOOKUP_KEY_WEB,
logging-log4j2 git commit: LOG4J2-2076 Update changes.xml
Repository: logging-log4j2 Updated Branches: refs/heads/master 44db87d0e -> fa71e1525 LOG4J2-2076 Update changes.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/fa71e152 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/fa71e152 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/fa71e152 Branch: refs/heads/master Commit: fa71e15252afc0c2f8c3c749842184df9186380f Parents: 44db87d Author: Mikael StåldalAuthored: Thu Oct 19 21:51:38 2017 +0200 Committer: Mikael Ståldal Committed: Thu Oct 19 21:51:38 2017 +0200 -- src/changes/changes.xml | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/fa71e152/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 331aa0d..3cb4b35 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -31,6 +31,9 @@ - "remove" - Removed --> + +Split up log4j-nosql into one module per appender. + Add possibility of sending the key of a message to Kafka using KafkaAppender.
[01/11] logging-log4j2 git commit: LOG4J2-2076 Cassandra appender in own module
Repository: logging-log4j2 Updated Branches: refs/heads/master f05b1aa19 -> 44db87d0e http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d3f9719f/log4j-nosql/src/test/resources/cassandra.yaml -- diff --git a/log4j-nosql/src/test/resources/cassandra.yaml b/log4j-nosql/src/test/resources/cassandra.yaml deleted file mode 100644 index 356e43d..000 --- a/log4j-nosql/src/test/resources/cassandra.yaml +++ /dev/null @@ -1,901 +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 express or implied. -# See the license for the specific language governing permissions and -# limitations under the license. - -# Cassandra storage config YAML - -# NOTE: -# See http://wiki.apache.org/cassandra/StorageConfiguration for -# full explanations of configuration directives -# /NOTE - -# The name of the cluster. This is mainly used to prevent machines in -# one logical cluster from joining another. -cluster_name: 'Test Cluster' - -# This defines the number of tokens randomly assigned to this node on the ring -# The more tokens, relative to other nodes, the larger the proportion of data -# that this node will store. You probably want all nodes to have the same number -# of tokens assuming they have equal hardware capability. -# -# If you leave this unspecified, Cassandra will use the default of 1 token for legacy compatibility, -# and will use the initial_token as described below. -# -# Specifying initial_token will override this setting on the node's initial start, -# on subsequent starts, this setting will apply even if initial token is set. -# -# If you already have a cluster with 1 token per node, and wish to migrate to -# multiple tokens per node, see http://wiki.apache.org/cassandra/Operations -num_tokens: 256 - -# initial_token allows you to specify tokens manually. While you can use # it with -# vnodes (num_tokens > 1, above) -- in which case you should provide a -# comma-separated list -- it's primarily used when adding nodes # to legacy clusters -# that do not have vnodes enabled. -# initial_token: - -# See http://wiki.apache.org/cassandra/HintedHandoff -# May either be "true" or "false" to enable globally, or contain a list -# of data centers to enable per-datacenter. -# hinted_handoff_enabled: DC1,DC2 -hinted_handoff_enabled: true -# this defines the maximum amount of time a dead host will have hints -# generated. After it has been dead this long, new hints for it will not be -# created until it has been seen alive and gone down again. -max_hint_window_in_ms: 1080 # 3 hours -# Maximum throttle in KBs per second, per delivery thread. This will be -# reduced proportionally to the number of nodes in the cluster. (If there -# are two nodes in the cluster, each delivery thread will use the maximum -# rate; if there are three, each will throttle to half of the maximum, -# since we expect two nodes to be delivering hints simultaneously.) -hinted_handoff_throttle_in_kb: 1024 -# Number of threads with which to deliver hints; -# Consider increasing this number when you have multi-dc deployments, since -# cross-dc handoff tends to be slower -max_hints_delivery_threads: 2 - -# Maximum throttle in KBs per second, total. This will be -# reduced proportionally to the number of nodes in the cluster. -batchlog_replay_throttle_in_kb: 1024 - -# Authentication backend, implementing IAuthenticator; used to identify users -# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthenticator, -# PasswordAuthenticator}. -# -# - AllowAllAuthenticator performs no checks - set it to disable authentication. -# - PasswordAuthenticator relies on username/password pairs to authenticate -# users. It keeps usernames and hashed passwords in system_auth.credentials table. -# Please increase system_auth keyspace replication factor if you use this authenticator. -# If using PasswordAuthenticator, CassandraRoleManager must also be used (see below) -authenticator: AllowAllAuthenticator - -# Authorization backend, implementing IAuthorizer; used to limit access/provide permissions -# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthorizer, -# CassandraAuthorizer}. -# -# - AllowAllAuthorizer allows any action to any user - set it to disable authorization. -# - CassandraAuthorizer stores
[07/11] logging-log4j2 git commit: LOG4J2-2076 CouchDB and MongoDB appenders in own modules, remove log4j-nosql module
LOG4J2-2076 CouchDB and MongoDB appenders in own modules, remove log4j-nosql module Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/ebec215e Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/ebec215e Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/ebec215e Branch: refs/heads/master Commit: ebec215eb9604963ff9930252f3013121b4be751 Parents: d3f9719 Author: Mikael StåldalAuthored: Tue Oct 17 22:23:50 2017 +0200 Committer: Mikael Ståldal Committed: Tue Oct 17 22:23:50 2017 +0200 -- log4j-bom/pom.xml | 16 +- .../appender/db/AbstractDatabaseAppender.java | 2 +- .../appender/nosql/AbstractNoSqlConnection.java | 48 +++ .../core/appender/nosql/DefaultNoSqlObject.java | 66 +++ .../core/appender/nosql/NoSqlAppender.java | 96 + .../core/appender/nosql/NoSqlConnection.java| 76 .../appender/nosql/NoSqlDatabaseManager.java| 224 ++ .../log4j/core/appender/nosql/NoSqlObject.java | 63 +++ .../core/appender/nosql/NoSqlProvider.java | 49 +++ .../log4j/core/appender/nosql/package-info.java | 24 ++ .../core/appender/nosql/NoSqlAppenderTest.java | 62 +++ .../nosql/NoSqlDatabaseManagerTest.java | 427 +++ log4j-couchdb/pom.xml | 183 .../appender/couchdb/CouchDbConnection.java | 69 +++ .../nosql/appender/couchdb/CouchDbProvider.java | 161 +++ .../nosql/appender/couchdb/package-info.java| 20 + log4j-couchdb/src/site/markdown/index.md.vm | 48 +++ log4j-couchdb/src/site/site.xml | 52 +++ log4j-distribution/pom.xml | 40 +- log4j-mongodb/pom.xml | 183 .../appender/mongodb/MongoDbConnection.java | 96 + .../nosql/appender/mongodb/MongoDbObject.java | 66 +++ .../nosql/appender/mongodb/MongoDbProvider.java | 351 +++ .../nosql/appender/mongodb/package-info.java| 20 + log4j-mongodb/src/site/markdown/index.md.vm | 48 +++ log4j-mongodb/src/site/site.xml | 52 +++ .../nosql/appender/mongodb/MongoDbAuthTest.java | 40 ++ .../appender/mongodb/MongoDbCappedTest.java | 40 ++ .../nosql/appender/mongodb/MongoDbTest.java | 40 ++ .../src/test/resources/log4j2-mongodb-auth.xml | 30 ++ .../test/resources/log4j2-mongodb-capped.xml| 30 ++ .../src/test/resources/log4j2-mongodb.xml | 30 ++ log4j-nosql/pom.xml | 194 - .../nosql/appender/AbstractNoSqlConnection.java | 48 --- .../nosql/appender/DefaultNoSqlObject.java | 66 --- .../log4j/nosql/appender/NoSqlAppender.java | 106 - .../log4j/nosql/appender/NoSqlConnection.java | 76 .../nosql/appender/NoSqlDatabaseManager.java| 224 -- .../log4j/nosql/appender/NoSqlObject.java | 63 --- .../log4j/nosql/appender/NoSqlProvider.java | 49 --- .../appender/couchdb/CouchDbConnection.java | 69 --- .../nosql/appender/couchdb/CouchDbProvider.java | 161 --- .../nosql/appender/couchdb/package-info.java| 20 - .../appender/mongodb/MongoDbConnection.java | 96 - .../nosql/appender/mongodb/MongoDbObject.java | 66 --- .../nosql/appender/mongodb/MongoDbProvider.java | 351 --- .../nosql/appender/mongodb/package-info.java| 20 - .../log4j/nosql/appender/package-info.java | 34 -- log4j-nosql/src/site/markdown/index.md.vm | 77 log4j-nosql/src/site/site.xml | 52 --- .../log4j/nosql/appender/MongoDbAuthTest.java | 40 -- .../log4j/nosql/appender/MongoDbCappedTest.java | 40 -- .../log4j/nosql/appender/MongoDbTest.java | 40 -- .../log4j/nosql/appender/NoSqlAppenderTest.java | 62 --- .../appender/NoSqlDatabaseManagerTest.java | 427 --- .../src/test/resources/log4j2-mongodb-auth.xml | 30 -- .../test/resources/log4j2-mongodb-capped.xml| 30 -- .../src/test/resources/log4j2-mongodb.xml | 30 -- pom.xml | 3 +- src/site/markdown/javadoc.md| 4 +- src/site/markdown/maven-artifacts.md.vm | 18 +- src/site/site.xml | 4 +- src/site/xdoc/runtime-dependencies.xml | 47 +- 63 files changed, 2790 insertions(+), 2509 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-bom/pom.xml -- diff --git a/log4j-bom/pom.xml b/log4j-bom/pom.xml index 129aa91..96bf601 100644 --- a/log4j-bom/pom.xml +++ b/log4j-bom/pom.xml @@ -84,10 +84,22 @@ log4j-web ${project.version}
[05/11] logging-log4j2 git commit: LOG4J2-2076 CouchDB and MongoDB appenders in own modules, remove log4j-nosql module
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlObject.java -- diff --git a/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlObject.java b/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlObject.java deleted file mode 100644 index 191d1a8..000 --- a/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlObject.java +++ /dev/null @@ -1,63 +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 express or implied. - * See the license for the specific language governing permissions and - * limitations under the license. - */ -package org.apache.logging.log4j.nosql.appender; - -/** - * Represents a simple POJO object inserted into a NoSQL object. - * - * @param Specifies what type of underlying object (such as a MongoDB BasicDBObject) this NoSqlObject wraps. - */ -public interface NoSqlObject { -/** - * Sets the value of a property on this object to a String or primitive. - * - * @param field The name of the property - * @param value The value of the property - */ -void set(String field, Object value); - -/** - * Sets the value of a property on this object to a nested complex object. - * - * @param field The name of the property - * @param value The value of the property - */ -void set(String field, NoSqlObject value); - -/** - * Sets the value of a property on this object to an array of Strings or primitives. - * - * @param field The name of the property - * @param values The values for the property - */ -void set(String field, Object[] values); - -/** - * Sets the value of a property on this object to an array of nested complex objects. - * - * @param field The name of the property - * @param values The values for the property - */ -void set(String field, NoSqlObject[] values); - -/** - * Obtains the underlying NoSQL library-specific object that this object wraps. - * - * @return the wrapped object. - */ -W unwrap(); -} http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlProvider.java -- diff --git a/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlProvider.java b/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlProvider.java deleted file mode 100644 index 75692bd..000 --- a/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlProvider.java +++ /dev/null @@ -1,49 +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 express or implied. - * See the license for the specific language governing permissions and - * limitations under the license. - */ -package org.apache.logging.log4j.nosql.appender; - -/** - * Implementations of this class are plugins for configuring the {@link NoSqlAppender} with the proper provider - * (MongoDB, etc.). - * - * @param Specifies which implementation of {@link NoSqlConnection} this provider provides. - */ -public interface NoSqlProvider>> { - -/** - * Obtains a connection from this provider. The concept of a connection in this case is not strictly an active - * duplex UDP or TCP connection to the underlying database. It can be thought of more as a gateway, a path for - * inserting objects that may use a persistent connection or may use HTTP web service calls, etc. - * - * Where applicable, this method should
[11/11] logging-log4j2 git commit: LOG4J2-2076 Rename packages
LOG4J2-2076 Rename packages Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/44db87d0 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/44db87d0 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/44db87d0 Branch: refs/heads/master Commit: 44db87d0e921bac3b207f575889618ced5288e5f Parents: 98a66a1 Author: Mikael StåldalAuthored: Thu Oct 19 21:47:31 2017 +0200 Committer: Mikael Ståldal Committed: Thu Oct 19 21:47:31 2017 +0200 -- .../log4j/cassandra/CassandraAppender.java | 185 ++ .../log4j/cassandra/CassandraManager.java | 218 .../cassandra/ClockTimestampGenerator.java | 34 ++ .../logging/log4j/cassandra/package-info.java | 23 ++ .../appender/cassandra/CassandraAppender.java | 185 -- .../appender/cassandra/CassandraManager.java| 218 .../cassandra/ClockTimestampGenerator.java | 34 -- .../nosql/appender/cassandra/package-info.java | 23 -- .../log4j/cassandra/CassandraAppenderIT.java| 96 + .../logging/log4j/cassandra/CassandraRule.java | 141 .../appender/cassandra/CassandraAppenderIT.java | 96 - .../nosql/appender/cassandra/CassandraRule.java | 141 .../test/resources/CassandraAppenderTest.xml| 2 +- .../log4j/couchdb/CouchDbConnection.java| 69 .../logging/log4j/couchdb/CouchDbProvider.java | 161 + .../logging/log4j/couchdb/package-info.java | 20 ++ .../appender/couchdb/CouchDbConnection.java | 69 .../nosql/appender/couchdb/CouchDbProvider.java | 161 - .../nosql/appender/couchdb/package-info.java| 20 -- .../log4j/mongodb/MongoDbConnection.java| 96 + .../logging/log4j/mongodb/MongoDbObject.java| 66 .../logging/log4j/mongodb/MongoDbProvider.java | 351 +++ .../logging/log4j/mongodb/package-info.java | 20 ++ .../appender/mongodb/MongoDbConnection.java | 96 - .../nosql/appender/mongodb/MongoDbObject.java | 66 .../nosql/appender/mongodb/MongoDbProvider.java | 351 --- .../nosql/appender/mongodb/package-info.java| 20 -- .../logging/log4j/mongodb/MongoDbAuthTest.java | 40 +++ .../log4j/mongodb/MongoDbCappedTest.java| 40 +++ .../logging/log4j/mongodb/MongoDbTest.java | 40 +++ .../nosql/appender/mongodb/MongoDbAuthTest.java | 40 --- .../appender/mongodb/MongoDbCappedTest.java | 40 --- .../nosql/appender/mongodb/MongoDbTest.java | 40 --- src/site/xdoc/manual/appenders.xml | 2 +- 34 files changed, 1602 insertions(+), 1602 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/44db87d0/log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraAppender.java -- diff --git a/log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraAppender.java b/log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraAppender.java new file mode 100644 index 000..7a9ade9 --- /dev/null +++ b/log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraAppender.java @@ -0,0 +1,185 @@ +/* + * 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.cassandra; + +import com.datastax.driver.core.BatchStatement; +import org.apache.logging.log4j.core.Core; +import org.apache.logging.log4j.core.Filter; +import org.apache.logging.log4j.core.appender.AbstractAppender; +import org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender; +import org.apache.logging.log4j.core.appender.db.ColumnMapping; +import org.apache.logging.log4j.core.config.plugins.Plugin; +import org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute; +import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory; +import org.apache.logging.log4j.core.config.plugins.PluginElement; +import
[09/11] logging-log4j2 git commit: Merge branch 'master' into LOG4J2-2076
Merge branch 'master' into LOG4J2-2076 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/98a66a14 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/98a66a14 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/98a66a14 Branch: refs/heads/master Commit: 98a66a14561e7b1525a98080be1362e0243a56d4 Parents: e54e250 f05b1aa Author: Mikael StåldalAuthored: Thu Oct 19 21:16:18 2017 +0200 Committer: Mikael Ståldal Committed: Thu Oct 19 21:16:18 2017 +0200 -- .../org/apache/logging/log4j/core/layout/CsvParameterLayout.java | 2 +- src/changes/changes.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) --
[03/11] logging-log4j2 git commit: LOG4J2-2076 Cassandra appender in own module
LOG4J2-2076 Cassandra appender in own module Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d3f9719f Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d3f9719f Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d3f9719f Branch: refs/heads/master Commit: d3f9719f9434abb82ec06c7c4eefc06c72d710bf Parents: ff5e664 Author: Mikael StåldalAuthored: Mon Oct 16 22:01:28 2017 +0200 Committer: Mikael Ståldal Committed: Mon Oct 16 22:03:33 2017 +0200 -- log4j-cassandra/pom.xml | 200 .../appender/cassandra/CassandraAppender.java | 185 .../appender/cassandra/CassandraManager.java| 218 + .../cassandra/ClockTimestampGenerator.java | 34 + .../nosql/appender/cassandra/package-info.java | 23 + log4j-cassandra/src/site/markdown/index.md.vm | 24 + log4j-cassandra/src/site/site.xml | 52 ++ .../appender/cassandra/CassandraAppenderIT.java | 96 ++ .../nosql/appender/cassandra/CassandraRule.java | 141 +++ .../test/resources/CassandraAppenderTest.xml| 40 + .../src/test/resources/cassandra.yaml | 901 +++ log4j-nosql/pom.xml | 19 +- .../appender/cassandra/CassandraAppender.java | 185 .../appender/cassandra/CassandraManager.java| 218 - .../cassandra/ClockTimestampGenerator.java | 34 - .../nosql/appender/cassandra/package-info.java | 23 - log4j-nosql/src/site/markdown/index.md.vm | 2 - .../appender/cassandra/CassandraAppenderIT.java | 96 -- .../nosql/appender/cassandra/CassandraRule.java | 141 --- .../test/resources/CassandraAppenderTest.xml| 40 - log4j-nosql/src/test/resources/cassandra.yaml | 901 --- pom.xml | 1 + src/site/xdoc/runtime-dependencies.xml | 14 +- 23 files changed, 1929 insertions(+), 1659 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d3f9719f/log4j-cassandra/pom.xml -- diff --git a/log4j-cassandra/pom.xml b/log4j-cassandra/pom.xml new file mode 100644 index 000..9fab242 --- /dev/null +++ b/log4j-cassandra/pom.xml @@ -0,0 +1,200 @@ + + + +http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> + +org.apache.logging.log4j +log4j +2.10.0-SNAPSHOT + + 4.0.0 + + log4j-cassandra + Apache Log4j Cassandra + +Cassandra appender for Log4j. + + +${basedir}/.. +Cassandra Documentation +/log4j-cassandra +org.apache.logging.log4j.cassandra + + + + + org.apache.logging.log4j + log4j-core + + + com.datastax.cassandra + cassandra-driver-core + + + + junit + junit + + + org.mockito + mockito-core + test + + + org.apache.logging.log4j + log4j-api + test-jar + + + org.apache.logging.log4j + log4j-core + test-jar + + + + org.apache.cassandra + cassandra-all + 2.2.8 + test + + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + + + + + org.apache.logging.log4j + log4j-slf4j-impl + test + + + + + + +org.apache.felix +maven-bundle-plugin + + +org.apache.logging.log4j.core +* + + + + + + + + +org.apache.maven.plugins +maven-changes-plugin +${changes.plugin.version} + + + + changes-report + + + + + %URL%/show_bug.cgi?id=%ISSUE% + true + + + +org.apache.maven.plugins +maven-checkstyle-plugin +${checkstyle.plugin.version} + + + ${log4jParentDir}/checkstyle.xml + ${log4jParentDir}/checkstyle-suppressions.xml + false + basedir=${basedir} + licensedir=${log4jParentDir}/checkstyle-header.txt + + + +org.apache.maven.plugins +maven-javadoc-plugin +${javadoc.plugin.version} + + + + false + true + + + +non-aggregate + + javadoc + + + + + +org.codehaus.mojo +findbugs-maven-plugin +
[08/11] logging-log4j2 git commit: Merge branch 'master' into LOG4J2-2076
Merge branch 'master' into LOG4J2-2076 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/e54e2505 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e54e2505 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e54e2505 Branch: refs/heads/master Commit: e54e2505f5e6579a25848d39ed2fbd7a6d03c5e5 Parents: ebec215 9126644 Author: Mikael StåldalAuthored: Wed Oct 18 22:14:54 2017 +0200 Committer: Mikael Ståldal Committed: Wed Oct 18 22:14:54 2017 +0200 -- log4j-core/pom.xml| 4 ++-- .../logging/log4j/core/appender/ConsoleAppender.java | 2 +- .../core/appender/db/AbstractDatabaseManager.java | 2 +- pom.xml | 14 +++--- src/changes/changes.xml | 9 ++--- 5 files changed, 17 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e54e2505/pom.xml --
[04/11] logging-log4j2 git commit: LOG4J2-2076 CouchDB and MongoDB appenders in own modules, remove log4j-nosql module
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-nosql/src/test/resources/log4j2-mongodb.xml -- diff --git a/log4j-nosql/src/test/resources/log4j2-mongodb.xml b/log4j-nosql/src/test/resources/log4j2-mongodb.xml deleted file mode 100644 index c759054..000 --- a/log4j-nosql/src/test/resources/log4j2-mongodb.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/pom.xml -- diff --git a/pom.xml b/pom.xml index 739c090..3b96fdc 100644 --- a/pom.xml +++ b/pom.xml @@ -1290,7 +1290,8 @@ log4j-samples log4j-osgi log4j-bom -log4j-nosql +log4j-couchdb +log4j-mongodb log4j-cassandra log4j-web log4j-perf http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/src/site/markdown/javadoc.md -- diff --git a/src/site/markdown/javadoc.md b/src/site/markdown/javadoc.md index b2e435f..00cd556 100644 --- a/src/site/markdown/javadoc.md +++ b/src/site/markdown/javadoc.md @@ -44,4 +44,6 @@ Component | Description [Apache Flume Appender](log4j-flume-ng/apidocs/index.html) | An Appender that allows applications to send logging events to Apache Flume Agents. [Log4j JMX GUI](log4j-jmx-gui/apidocs/index.html) | A Java Swing-based client for remotely viewing the status logger and editing the Log4j configuration. [Log4j Web Application Support](log4j-web/apidocs/index.html) | Additional classes that enable multiple configurations within a Servlet Container. -[Log4j NoSQL Support](log4j-nosql/apidocs/index.html) | Additional Appenders for NoSQL databases such as MongoDB and CouchDB. +[Log4j CouchDB Support](log4j-couchdb/apidocs/index.html) | Additional Appender for CouchDB. +[Log4j MongoDB Support](log4j-mongodb/apidocs/index.html) | Additional Appender for MongoDB. +[Log4j Cassandra Support](log4j-cassandra/apidocs/index.html) | Additional Appender for Cassandra. http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/src/site/markdown/maven-artifacts.md.vm -- diff --git a/src/site/markdown/maven-artifacts.md.vm b/src/site/markdown/maven-artifacts.md.vm index 272cf2e..175fb2f 100644 --- a/src/site/markdown/maven-artifacts.md.vm +++ b/src/site/markdown/maven-artifacts.md.vm @@ -224,11 +224,23 @@ to SLF4J. The SLF4J Bridge must NOT be on the class path when this is in use. #dependencies(['log4j-to-slf4j']) -$h3 NoSQL Appenders +$h3 CouchDB -If your configuration uses one of the NoSQL Appenders, then add the following. +If your configuration uses the NoSQL CouchDB appender, then add the following. -#dependencies(['log4j-nosql']) +#dependencies(['log4j-couchdb']) + +$h3 MongoDB + +If your configuration uses the NoSQL MongoDB appender, then add the following. + +#dependencies(['log4j-mongodb']) + +$h3 Cassandra + +If your configuration uses the Cassandra appender, then add the following. + +#dependencies(['log4j-cassandra']) $h3 IO Streams http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/src/site/site.xml -- diff --git a/src/site/site.xml b/src/site/site.xml index 6de65be..d323cd2 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -272,7 +272,9 @@ - + + + http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/src/site/xdoc/runtime-dependencies.xml -- diff --git a/src/site/xdoc/runtime-dependencies.xml b/src/site/xdoc/runtime-dependencies.xml index e319c34..1f66725 100644 --- a/src/site/xdoc/runtime-dependencies.xml +++ b/src/site/xdoc/runtime-dependencies.xml @@ -121,8 +121,13 @@ Automatic Module -log4j-nosql -org.apache.logging.log4j.nosql +log4j-couchdb +org.apache.logging.log4j.couchdb +Automatic Module + + +log4j-mongodb +org.apache.logging.log4j.mongodb Automatic Module @@ -255,11 +260,11 @@ NoSQL Appender with MongoDB provider - MongoDB Java Client driver and Log4j NoSQL library + MongoDB Java Client driver and Log4j MongoDB library NoSQL Appender with Apache CouchDB provider - LightCouch CouchDB client library and Log4j NoSQL library + LightCouch CouchDB client library and Log4j CouchDB library Cassandra Appender @@ -368,34 +373,24 @@ Note that this works with the Servlet 2.5 API
[10/11] logging-log4j2 git commit: LOG4J2-2076 Rename packages
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/44db87d0/log4j-couchdb/src/main/java/org/apache/logging/log4j/nosql/appender/couchdb/CouchDbProvider.java -- diff --git a/log4j-couchdb/src/main/java/org/apache/logging/log4j/nosql/appender/couchdb/CouchDbProvider.java b/log4j-couchdb/src/main/java/org/apache/logging/log4j/nosql/appender/couchdb/CouchDbProvider.java deleted file mode 100644 index cdae592..000 --- a/log4j-couchdb/src/main/java/org/apache/logging/log4j/nosql/appender/couchdb/CouchDbProvider.java +++ /dev/null @@ -1,161 +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 express or implied. - * See the license for the specific language governing permissions and - * limitations under the license. - */ -package org.apache.logging.log4j.nosql.appender.couchdb; - -import java.lang.reflect.Method; - -import org.apache.logging.log4j.Logger; -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.PluginFactory; -import org.apache.logging.log4j.core.config.plugins.convert.TypeConverters; -import org.apache.logging.log4j.core.config.plugins.validation.constraints.ValidHost; -import org.apache.logging.log4j.core.config.plugins.validation.constraints.ValidPort; -import org.apache.logging.log4j.core.util.NameUtil; -import org.apache.logging.log4j.core.appender.nosql.NoSqlProvider; -import org.apache.logging.log4j.status.StatusLogger; -import org.apache.logging.log4j.util.LoaderUtil; -import org.apache.logging.log4j.util.Strings; -import org.lightcouch.CouchDbClient; -import org.lightcouch.CouchDbProperties; - -/** - * The Apache CouchDB implementation of {@link NoSqlProvider}. - */ -@Plugin(name = "CouchDB", category = "Core", printObject = true) -public final class CouchDbProvider implements NoSqlProvider { -private static final int HTTP = 80; -private static final int HTTPS = 443; -private static final Logger LOGGER = StatusLogger.getLogger(); - -private final CouchDbClient client; -private final String description; - -private CouchDbProvider(final CouchDbClient client, final String description) { -this.client = client; -this.description = "couchDb{ " + description + " }"; -} - -@Override -public CouchDbConnection getConnection() { -return new CouchDbConnection(this.client); -} - -@Override -public String toString() { -return this.description; -} - -/** - * Factory method for creating an Apache CouchDB provider within the plugin manager. - * - * @param databaseName The name of the database to which log event documents will be written. - * @param protocol Either "http" or "https," defaults to "http" and mutually exclusive with - * {@code factoryClassName!=null}. - * @param server The host name of the CouchDB server, defaults to localhost and mutually exclusive with - * {@code factoryClassName!=null}. - * @param port The port that CouchDB is listening on, defaults to 80 if {@code protocol} is "http" and 443 if - * {@code protocol} is "https," and mutually exclusive with - * {@code factoryClassName!=null}. - * @param username The username to authenticate against the MongoDB server with, mutually exclusive with - * {@code factoryClassName!=null}. - * @param password The password to authenticate against the MongoDB server with, mutually exclusive with - * {@code factoryClassName!=null}. - * @param factoryClassName A fully qualified class name containing a static factory method capable of returning a - * {@link CouchDbClient} or {@link CouchDbProperties}. - * @param factoryMethodName The name of the public static factory method belonging to the aforementioned factory - * class. - * @return a new Apache CouchDB provider. - */ -@PluginFactory -public static CouchDbProvider createNoSqlProvider( -@PluginAttribute("databaseName") final String databaseName, -@PluginAttribute("protocol") String protocol, -
[02/11] logging-log4j2 git commit: LOG4J2-2076 Cassandra appender in own module
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d3f9719f/log4j-cassandra/src/test/resources/cassandra.yaml -- diff --git a/log4j-cassandra/src/test/resources/cassandra.yaml b/log4j-cassandra/src/test/resources/cassandra.yaml new file mode 100644 index 000..356e43d --- /dev/null +++ b/log4j-cassandra/src/test/resources/cassandra.yaml @@ -0,0 +1,901 @@ +# 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. + +# Cassandra storage config YAML + +# NOTE: +# See http://wiki.apache.org/cassandra/StorageConfiguration for +# full explanations of configuration directives +# /NOTE + +# The name of the cluster. This is mainly used to prevent machines in +# one logical cluster from joining another. +cluster_name: 'Test Cluster' + +# This defines the number of tokens randomly assigned to this node on the ring +# The more tokens, relative to other nodes, the larger the proportion of data +# that this node will store. You probably want all nodes to have the same number +# of tokens assuming they have equal hardware capability. +# +# If you leave this unspecified, Cassandra will use the default of 1 token for legacy compatibility, +# and will use the initial_token as described below. +# +# Specifying initial_token will override this setting on the node's initial start, +# on subsequent starts, this setting will apply even if initial token is set. +# +# If you already have a cluster with 1 token per node, and wish to migrate to +# multiple tokens per node, see http://wiki.apache.org/cassandra/Operations +num_tokens: 256 + +# initial_token allows you to specify tokens manually. While you can use # it with +# vnodes (num_tokens > 1, above) -- in which case you should provide a +# comma-separated list -- it's primarily used when adding nodes # to legacy clusters +# that do not have vnodes enabled. +# initial_token: + +# See http://wiki.apache.org/cassandra/HintedHandoff +# May either be "true" or "false" to enable globally, or contain a list +# of data centers to enable per-datacenter. +# hinted_handoff_enabled: DC1,DC2 +hinted_handoff_enabled: true +# this defines the maximum amount of time a dead host will have hints +# generated. After it has been dead this long, new hints for it will not be +# created until it has been seen alive and gone down again. +max_hint_window_in_ms: 1080 # 3 hours +# Maximum throttle in KBs per second, per delivery thread. This will be +# reduced proportionally to the number of nodes in the cluster. (If there +# are two nodes in the cluster, each delivery thread will use the maximum +# rate; if there are three, each will throttle to half of the maximum, +# since we expect two nodes to be delivering hints simultaneously.) +hinted_handoff_throttle_in_kb: 1024 +# Number of threads with which to deliver hints; +# Consider increasing this number when you have multi-dc deployments, since +# cross-dc handoff tends to be slower +max_hints_delivery_threads: 2 + +# Maximum throttle in KBs per second, total. This will be +# reduced proportionally to the number of nodes in the cluster. +batchlog_replay_throttle_in_kb: 1024 + +# Authentication backend, implementing IAuthenticator; used to identify users +# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthenticator, +# PasswordAuthenticator}. +# +# - AllowAllAuthenticator performs no checks - set it to disable authentication. +# - PasswordAuthenticator relies on username/password pairs to authenticate +# users. It keeps usernames and hashed passwords in system_auth.credentials table. +# Please increase system_auth keyspace replication factor if you use this authenticator. +# If using PasswordAuthenticator, CassandraRoleManager must also be used (see below) +authenticator: AllowAllAuthenticator + +# Authorization backend, implementing IAuthorizer; used to limit access/provide permissions +# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthorizer, +# CassandraAuthorizer}. +# +# - AllowAllAuthorizer allows any action to any user - set it to disable authorization. +# - CassandraAuthorizer stores permissions in system_auth.permissions table. Please +# increase system_auth
[06/11] logging-log4j2 git commit: LOG4J2-2076 CouchDB and MongoDB appenders in own modules, remove log4j-nosql module
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-couchdb/src/site/markdown/index.md.vm -- diff --git a/log4j-couchdb/src/site/markdown/index.md.vm b/log4j-couchdb/src/site/markdown/index.md.vm new file mode 100644 index 000..a6b9639 --- /dev/null +++ b/log4j-couchdb/src/site/markdown/index.md.vm @@ -0,0 +1,48 @@ + + +#set($h1='#') +#set($h2='##') +## TODO: use properties for dynamic dependency versions + +$h1 CouchDB Appender + +[Apache CouchDB](https://couchdb.apache.org/) is supported through the +[LightCouch](http://www.lightcouch.org/) driver. + +``` + + + +org.lightcouch +lightcouch +0.0.6 + + + + + + org.lightcouch + lightcouch + + +``` + +$h2 Requirements + +The CouchDB Appender is dependent on the Log4j 2 API and implementation. +For more information, see [Runtime Dependencies](../runtime-dependencies.html). http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-couchdb/src/site/site.xml -- diff --git a/log4j-couchdb/src/site/site.xml b/log4j-couchdb/src/site/site.xml new file mode 100644 index 000..affd43f --- /dev/null +++ b/log4j-couchdb/src/site/site.xml @@ -0,0 +1,52 @@ + +http://maven.apache.org/DECORATION/1.4.0; + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.4.0 http://maven.apache.org/xsd/decoration-1.4.0.xsd;> + + + http://www.apache.org/; /> + http://logging.apache.org/"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-distribution/pom.xml -- diff --git a/log4j-distribution/pom.xml b/log4j-distribution/pom.xml index 651717a..fa46876 100644 --- a/log4j-distribution/pom.xml +++ b/log4j-distribution/pom.xml @@ -240,18 +240,52 @@ org.apache.logging.log4j - log4j-nosql + log4j-couchdb ${project.version} org.apache.logging.log4j - log4j-nosql + log4j-couchdb ${project.version} sources org.apache.logging.log4j - log4j-nosql + log4j-couchdb + ${project.version} + javadoc + + + org.apache.logging.log4j + log4j-mongodb + ${project.version} + + + org.apache.logging.log4j + log4j-mongodb + ${project.version} + sources + + + org.apache.logging.log4j + log4j-mongodb + ${project.version} + javadoc + + + org.apache.logging.log4j + log4j-cassandra + ${project.version} + + + org.apache.logging.log4j + log4j-cassandra + ${project.version} + sources + + + org.apache.logging.log4j + log4j-cassandra ${project.version} javadoc http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-mongodb/pom.xml -- diff --git a/log4j-mongodb/pom.xml b/log4j-mongodb/pom.xml new file mode 100644 index 000..29c511c --- /dev/null +++ b/log4j-mongodb/pom.xml @@ -0,0 +1,183 @@ + + + +http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> + +org.apache.logging.log4j +log4j +2.10.0-SNAPSHOT + + 4.0.0 + + log4j-mongodb + Apache Log4j MongoDB + +MongoDB appender for Log4j. + + +${basedir}/.. +MongoDB Documentation +/log4j-mongodb +org.apache.logging.log4j.mongodb + + + + + org.apache.logging.log4j + log4j-core + + + org.mongodb + mongo-java-driver + + + + junit + junit + + + org.mockito + mockito-core + test + + + org.apache.logging.log4j + log4j-api + test-jar + + + org.apache.logging.log4j + log4j-core + test-jar + + + org.apache.logging.log4j + log4j-slf4j-impl + test + + + + + + +org.apache.felix +maven-bundle-plugin + + +org.apache.logging.log4j.core +* + + + + + + + + +org.apache.maven.plugins +maven-changes-plugin +${changes.plugin.version} + + + + changes-report + + + + + %URL%/show_bug.cgi?id=%ISSUE% + true + + + +org.apache.maven.plugins +
[logging-log4j2] Git Push Summary
Repository: logging-log4j2 Updated Branches: refs/heads/LOG4J2-2076 [deleted] 44db87d0e
[2/2] logging-log4j2 git commit: LOG4J2-2076 Rename packages
LOG4J2-2076 Rename packages Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/44db87d0 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/44db87d0 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/44db87d0 Branch: refs/heads/LOG4J2-2076 Commit: 44db87d0e921bac3b207f575889618ced5288e5f Parents: 98a66a1 Author: Mikael StåldalAuthored: Thu Oct 19 21:47:31 2017 +0200 Committer: Mikael Ståldal Committed: Thu Oct 19 21:47:31 2017 +0200 -- .../log4j/cassandra/CassandraAppender.java | 185 ++ .../log4j/cassandra/CassandraManager.java | 218 .../cassandra/ClockTimestampGenerator.java | 34 ++ .../logging/log4j/cassandra/package-info.java | 23 ++ .../appender/cassandra/CassandraAppender.java | 185 -- .../appender/cassandra/CassandraManager.java| 218 .../cassandra/ClockTimestampGenerator.java | 34 -- .../nosql/appender/cassandra/package-info.java | 23 -- .../log4j/cassandra/CassandraAppenderIT.java| 96 + .../logging/log4j/cassandra/CassandraRule.java | 141 .../appender/cassandra/CassandraAppenderIT.java | 96 - .../nosql/appender/cassandra/CassandraRule.java | 141 .../test/resources/CassandraAppenderTest.xml| 2 +- .../log4j/couchdb/CouchDbConnection.java| 69 .../logging/log4j/couchdb/CouchDbProvider.java | 161 + .../logging/log4j/couchdb/package-info.java | 20 ++ .../appender/couchdb/CouchDbConnection.java | 69 .../nosql/appender/couchdb/CouchDbProvider.java | 161 - .../nosql/appender/couchdb/package-info.java| 20 -- .../log4j/mongodb/MongoDbConnection.java| 96 + .../logging/log4j/mongodb/MongoDbObject.java| 66 .../logging/log4j/mongodb/MongoDbProvider.java | 351 +++ .../logging/log4j/mongodb/package-info.java | 20 ++ .../appender/mongodb/MongoDbConnection.java | 96 - .../nosql/appender/mongodb/MongoDbObject.java | 66 .../nosql/appender/mongodb/MongoDbProvider.java | 351 --- .../nosql/appender/mongodb/package-info.java| 20 -- .../logging/log4j/mongodb/MongoDbAuthTest.java | 40 +++ .../log4j/mongodb/MongoDbCappedTest.java| 40 +++ .../logging/log4j/mongodb/MongoDbTest.java | 40 +++ .../nosql/appender/mongodb/MongoDbAuthTest.java | 40 --- .../appender/mongodb/MongoDbCappedTest.java | 40 --- .../nosql/appender/mongodb/MongoDbTest.java | 40 --- src/site/xdoc/manual/appenders.xml | 2 +- 34 files changed, 1602 insertions(+), 1602 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/44db87d0/log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraAppender.java -- diff --git a/log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraAppender.java b/log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraAppender.java new file mode 100644 index 000..7a9ade9 --- /dev/null +++ b/log4j-cassandra/src/main/java/org/apache/logging/log4j/cassandra/CassandraAppender.java @@ -0,0 +1,185 @@ +/* + * 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.cassandra; + +import com.datastax.driver.core.BatchStatement; +import org.apache.logging.log4j.core.Core; +import org.apache.logging.log4j.core.Filter; +import org.apache.logging.log4j.core.appender.AbstractAppender; +import org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender; +import org.apache.logging.log4j.core.appender.db.ColumnMapping; +import org.apache.logging.log4j.core.config.plugins.Plugin; +import org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute; +import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory; +import org.apache.logging.log4j.core.config.plugins.PluginElement; +import
[1/2] logging-log4j2 git commit: LOG4J2-2076 Rename packages
Repository: logging-log4j2 Updated Branches: refs/heads/LOG4J2-2076 98a66a145 -> 44db87d0e http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/44db87d0/log4j-couchdb/src/main/java/org/apache/logging/log4j/nosql/appender/couchdb/CouchDbProvider.java -- diff --git a/log4j-couchdb/src/main/java/org/apache/logging/log4j/nosql/appender/couchdb/CouchDbProvider.java b/log4j-couchdb/src/main/java/org/apache/logging/log4j/nosql/appender/couchdb/CouchDbProvider.java deleted file mode 100644 index cdae592..000 --- a/log4j-couchdb/src/main/java/org/apache/logging/log4j/nosql/appender/couchdb/CouchDbProvider.java +++ /dev/null @@ -1,161 +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 express or implied. - * See the license for the specific language governing permissions and - * limitations under the license. - */ -package org.apache.logging.log4j.nosql.appender.couchdb; - -import java.lang.reflect.Method; - -import org.apache.logging.log4j.Logger; -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.PluginFactory; -import org.apache.logging.log4j.core.config.plugins.convert.TypeConverters; -import org.apache.logging.log4j.core.config.plugins.validation.constraints.ValidHost; -import org.apache.logging.log4j.core.config.plugins.validation.constraints.ValidPort; -import org.apache.logging.log4j.core.util.NameUtil; -import org.apache.logging.log4j.core.appender.nosql.NoSqlProvider; -import org.apache.logging.log4j.status.StatusLogger; -import org.apache.logging.log4j.util.LoaderUtil; -import org.apache.logging.log4j.util.Strings; -import org.lightcouch.CouchDbClient; -import org.lightcouch.CouchDbProperties; - -/** - * The Apache CouchDB implementation of {@link NoSqlProvider}. - */ -@Plugin(name = "CouchDB", category = "Core", printObject = true) -public final class CouchDbProvider implements NoSqlProvider { -private static final int HTTP = 80; -private static final int HTTPS = 443; -private static final Logger LOGGER = StatusLogger.getLogger(); - -private final CouchDbClient client; -private final String description; - -private CouchDbProvider(final CouchDbClient client, final String description) { -this.client = client; -this.description = "couchDb{ " + description + " }"; -} - -@Override -public CouchDbConnection getConnection() { -return new CouchDbConnection(this.client); -} - -@Override -public String toString() { -return this.description; -} - -/** - * Factory method for creating an Apache CouchDB provider within the plugin manager. - * - * @param databaseName The name of the database to which log event documents will be written. - * @param protocol Either "http" or "https," defaults to "http" and mutually exclusive with - * {@code factoryClassName!=null}. - * @param server The host name of the CouchDB server, defaults to localhost and mutually exclusive with - * {@code factoryClassName!=null}. - * @param port The port that CouchDB is listening on, defaults to 80 if {@code protocol} is "http" and 443 if - * {@code protocol} is "https," and mutually exclusive with - * {@code factoryClassName!=null}. - * @param username The username to authenticate against the MongoDB server with, mutually exclusive with - * {@code factoryClassName!=null}. - * @param password The password to authenticate against the MongoDB server with, mutually exclusive with - * {@code factoryClassName!=null}. - * @param factoryClassName A fully qualified class name containing a static factory method capable of returning a - * {@link CouchDbClient} or {@link CouchDbProperties}. - * @param factoryMethodName The name of the public static factory method belonging to the aforementioned factory - * class. - * @return a new Apache CouchDB provider. - */ -@PluginFactory -public static CouchDbProvider createNoSqlProvider( -@PluginAttribute("databaseName") final String
[04/13] logging-log4j2 git commit: wagon-ssh 2.10 -> 3.3.0.
wagon-ssh 2.10 -> 3.3.0. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/3281d152 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/3281d152 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/3281d152 Branch: refs/heads/LOG4J2-2076 Commit: 3281d15245ecbb6e5d7e052db18b55a92ff51672 Parents: fad3463 Author: Gary GregoryAuthored: Tue Oct 17 12:41:53 2017 -0600 Committer: Gary Gregory Committed: Tue Oct 17 12:41:53 2017 -0600 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3281d152/pom.xml -- diff --git a/pom.xml b/pom.xml index 79d8f94..048c74b 100644 --- a/pom.xml +++ b/pom.xml @@ -1046,7 +1046,7 @@ org.apache.maven.wagon wagon-ssh -2.10 +3.0.0
[06/13] logging-log4j2 git commit: Update Mockito from 2.10.0 to 2.11.0. Build passes with 'mvn clean install'.
Update Mockito from 2.10.0 to 2.11.0. Build passes with 'mvn clean install'. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/2313b947 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/2313b947 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/2313b947 Branch: refs/heads/LOG4J2-2076 Commit: 2313b947835126044458c2d14c06268edd1cf9a1 Parents: 85b7282 Author: Gary GregoryAuthored: Tue Oct 17 13:16:03 2017 -0600 Committer: Gary Gregory Committed: Tue Oct 17 13:16:03 2017 -0600 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2313b947/pom.xml -- diff --git a/pom.xml b/pom.xml index de88776..c4f8c0f 100644 --- a/pom.xml +++ b/pom.xml @@ -216,7 +216,7 @@ info 1.2.1 -2.10.0 +2.11.0 -Xms256m -Xmx1024m 1.7
[02/13] logging-log4j2 git commit: [LOG4J2-2078] Update LMAX disruptor from 3.3.6 to 3.3.7. Note that in order to get a passing build with 'mvn clean install' I had to revert in the previous commit th
[LOG4J2-2078] Update LMAX disruptor from 3.3.6 to 3.3.7. Note that in order to get a passing build with 'mvn clean install' I had to revert in the previous commit the changes for LOG4J2-2060 AbstractDatabaseManager should make a copy of LogEvents before holding references to them: AsyncLogger log events are mutable. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/247c91d0 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/247c91d0 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/247c91d0 Branch: refs/heads/LOG4J2-2076 Commit: 247c91d01cb4563cc4615eafd81fff5133b44b84 Parents: ecc2d35 Author: Gary GregoryAuthored: Tue Oct 17 09:22:53 2017 -0600 Committer: Gary Gregory Committed: Tue Oct 17 09:22:53 2017 -0600 -- pom.xml | 2 +- src/changes/changes.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/247c91d0/pom.xml -- diff --git a/pom.xml b/pom.xml index f27af6f..41b52c8 100644 --- a/pom.xml +++ b/pom.xml @@ -181,7 +181,7 @@ 2.9.1 3.2.18.RELEASE 1.7.0 -3.3.6 +3.3.7 1.2.10 3.7.0 3.7 http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/247c91d0/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 6dcb09e..4772a2e 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -92,6 +92,9 @@ The console appender should say why it cannot load JAnsi. + +Update LMAX disruptor from 3.3.6 to 3.3.7. +
[11/13] logging-log4j2 git commit: Merge branch 'master' into LOG4J2-2076
Merge branch 'master' into LOG4J2-2076 Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/e54e2505 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e54e2505 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e54e2505 Branch: refs/heads/LOG4J2-2076 Commit: e54e2505f5e6579a25848d39ed2fbd7a6d03c5e5 Parents: ebec215 9126644 Author: Mikael StåldalAuthored: Wed Oct 18 22:14:54 2017 +0200 Committer: Mikael Ståldal Committed: Wed Oct 18 22:14:54 2017 +0200 -- log4j-core/pom.xml| 4 ++-- .../logging/log4j/core/appender/ConsoleAppender.java | 2 +- .../core/appender/db/AbstractDatabaseManager.java | 2 +- pom.xml | 14 +++--- src/changes/changes.xml | 9 ++--- 5 files changed, 17 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e54e2505/pom.xml --
[12/13] logging-log4j2 git commit: [LOG4J2-2085] Wrong Apache Commons CSV version referenced in the Javadoc of CsvParameterLayout. Update Javadoc.
[LOG4J2-2085] Wrong Apache Commons CSV version referenced in the Javadoc of CsvParameterLayout. Update 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/f05b1aa1 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f05b1aa1 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f05b1aa1 Branch: refs/heads/LOG4J2-2076 Commit: f05b1aa192336236189d03fa7abc6b9335f53054 Parents: 9126644 Author: Gary GregoryAuthored: Wed Oct 18 16:39:56 2017 -0600 Committer: Gary Gregory Committed: Wed Oct 18 16:39:56 2017 -0600 -- .../org/apache/logging/log4j/core/layout/CsvParameterLayout.java | 2 +- src/changes/changes.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f05b1aa1/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 4b065d6..fe079fb 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 @@ -43,7 +43,7 @@ import org.apache.logging.log4j.status.StatusLogger; * {@code logger.debug(new ObjectArrayMessage(1, 2, "Bob"));} * * - * Depends on Apache Commons CSV 1.2. + * Depends on Apache Commons CSV 1.4. * * @since 2.4 */ http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f05b1aa1/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index c1bcc9f..331aa0d 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -92,6 +92,9 @@ The console appender should say why it cannot load JAnsi. + +Wrong Apache Commons CSV version referenced in the Javadoc of CsvParameterLayout. + Update LMAX disruptor from 3.3.6 to 3.3.7.
[03/13] logging-log4j2 git commit: [LOG4J2-2081] Update Apache Commons Compress from 1.14 to 1.15.
[LOG4J2-2081] Update Apache Commons Compress from 1.14 to 1.15. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/fad34631 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/fad34631 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/fad34631 Branch: refs/heads/LOG4J2-2076 Commit: fad34631f66a703c7aa2bf09a67df963e06dbb51 Parents: 247c91d Author: Gary GregoryAuthored: Tue Oct 17 12:32:45 2017 -0600 Committer: Gary Gregory Committed: Tue Oct 17 12:32:45 2017 -0600 -- pom.xml | 2 +- src/changes/changes.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/fad34631/pom.xml -- diff --git a/pom.xml b/pom.xml index 41b52c8..79d8f94 100644 --- a/pom.xml +++ b/pom.xml @@ -762,7 +762,7 @@ org.apache.commons commons-compress -1.14 +1.15 org.tukaani http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/fad34631/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 4772a2e..c1bcc9f 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -95,6 +95,9 @@ Update LMAX disruptor from 3.3.6 to 3.3.7. + +Update Apache Commons Compress from 1.14 to 1.15. +
[09/13] logging-log4j2 git commit: POM for jackson-dataformat-xml 2.9.1 depends on woodstox-core 5.0.3.
POM for jackson-dataformat-xml 2.9.1 depends on woodstox-core 5.0.3. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/66e17b6c Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/66e17b6c Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/66e17b6c Branch: refs/heads/LOG4J2-2076 Commit: 66e17b6c52e4cca2fe5b861171c5c4dadbf7d732 Parents: 1196b29 Author: Gary GregoryAuthored: Tue Oct 17 16:19:20 2017 -0600 Committer: Gary Gregory Committed: Tue Oct 17 16:19:20 2017 -0600 -- log4j-core/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/66e17b6c/log4j-core/pom.xml -- diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml index b90f1fd..dcac408 100644 --- a/log4j-core/pom.xml +++ b/log4j-core/pom.xml @@ -87,11 +87,11 @@ jackson-dataformat-xml true - + com.fasterxml.woodstox woodstox-core - 5.0.2 + 5.0.3 true
[05/13] logging-log4j2 git commit: Update tests from Wiremock 2.8.0 to 2.9.0.
Update tests from Wiremock 2.8.0 to 2.9.0. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/85b7282b Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/85b7282b Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/85b7282b Branch: refs/heads/LOG4J2-2076 Commit: 85b7282bbcad5f3176335b436e0ee1826cd8ec93 Parents: 3281d15 Author: Gary GregoryAuthored: Tue Oct 17 12:46:02 2017 -0600 Committer: Gary Gregory Committed: Tue Oct 17 12:46:02 2017 -0600 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/85b7282b/pom.xml -- diff --git a/pom.xml b/pom.xml index 048c74b..de88776 100644 --- a/pom.xml +++ b/pom.xml @@ -756,7 +756,7 @@ com.github.tomakehurst wiremock test -2.8.0 +2.9.0
[07/13] logging-log4j2 git commit: [LOG4J2-2074] The console appender should say why it cannot load JAnsi. Clean up exception message that comes through JAnsi.
[LOG4J2-2074] The console appender should say why it cannot load JAnsi. Clean up exception message that comes through JAnsi. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/00323c99 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/00323c99 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/00323c99 Branch: refs/heads/LOG4J2-2076 Commit: 00323c993db37f1b2ff2b6c90f43f8f58da80c40 Parents: 2313b94 Author: Gary GregoryAuthored: Tue Oct 17 13:35:27 2017 -0600 Committer: Gary Gregory Committed: Tue Oct 17 13:35:27 2017 -0600 -- .../org/apache/logging/log4j/core/appender/ConsoleAppender.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/00323c99/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java index 05ba855..bd2dc16 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java @@ -273,7 +273,7 @@ public final class ConsoleAppender extends AbstractOutputStreamAppender
[3/4] logging-log4j2 git commit: LOG4J2-2076 CouchDB and MongoDB appenders in own modules, remove log4j-nosql module
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-couchdb/src/site/markdown/index.md.vm -- diff --git a/log4j-couchdb/src/site/markdown/index.md.vm b/log4j-couchdb/src/site/markdown/index.md.vm new file mode 100644 index 000..a6b9639 --- /dev/null +++ b/log4j-couchdb/src/site/markdown/index.md.vm @@ -0,0 +1,48 @@ + + +#set($h1='#') +#set($h2='##') +## TODO: use properties for dynamic dependency versions + +$h1 CouchDB Appender + +[Apache CouchDB](https://couchdb.apache.org/) is supported through the +[LightCouch](http://www.lightcouch.org/) driver. + +``` + + + +org.lightcouch +lightcouch +0.0.6 + + + + + + org.lightcouch + lightcouch + + +``` + +$h2 Requirements + +The CouchDB Appender is dependent on the Log4j 2 API and implementation. +For more information, see [Runtime Dependencies](../runtime-dependencies.html). http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-couchdb/src/site/site.xml -- diff --git a/log4j-couchdb/src/site/site.xml b/log4j-couchdb/src/site/site.xml new file mode 100644 index 000..affd43f --- /dev/null +++ b/log4j-couchdb/src/site/site.xml @@ -0,0 +1,52 @@ + +http://maven.apache.org/DECORATION/1.4.0; + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.4.0 http://maven.apache.org/xsd/decoration-1.4.0.xsd;> + + + http://www.apache.org/; /> + http://logging.apache.org/"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-distribution/pom.xml -- diff --git a/log4j-distribution/pom.xml b/log4j-distribution/pom.xml index 651717a..fa46876 100644 --- a/log4j-distribution/pom.xml +++ b/log4j-distribution/pom.xml @@ -240,18 +240,52 @@ org.apache.logging.log4j - log4j-nosql + log4j-couchdb ${project.version} org.apache.logging.log4j - log4j-nosql + log4j-couchdb ${project.version} sources org.apache.logging.log4j - log4j-nosql + log4j-couchdb + ${project.version} + javadoc + + + org.apache.logging.log4j + log4j-mongodb + ${project.version} + + + org.apache.logging.log4j + log4j-mongodb + ${project.version} + sources + + + org.apache.logging.log4j + log4j-mongodb + ${project.version} + javadoc + + + org.apache.logging.log4j + log4j-cassandra + ${project.version} + + + org.apache.logging.log4j + log4j-cassandra + ${project.version} + sources + + + org.apache.logging.log4j + log4j-cassandra ${project.version} javadoc http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-mongodb/pom.xml -- diff --git a/log4j-mongodb/pom.xml b/log4j-mongodb/pom.xml new file mode 100644 index 000..29c511c --- /dev/null +++ b/log4j-mongodb/pom.xml @@ -0,0 +1,183 @@ + + + +http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> + +org.apache.logging.log4j +log4j +2.10.0-SNAPSHOT + + 4.0.0 + + log4j-mongodb + Apache Log4j MongoDB + +MongoDB appender for Log4j. + + +${basedir}/.. +MongoDB Documentation +/log4j-mongodb +org.apache.logging.log4j.mongodb + + + + + org.apache.logging.log4j + log4j-core + + + org.mongodb + mongo-java-driver + + + + junit + junit + + + org.mockito + mockito-core + test + + + org.apache.logging.log4j + log4j-api + test-jar + + + org.apache.logging.log4j + log4j-core + test-jar + + + org.apache.logging.log4j + log4j-slf4j-impl + test + + + + + + +org.apache.felix +maven-bundle-plugin + + +org.apache.logging.log4j.core +* + + + + + + + + +org.apache.maven.plugins +maven-changes-plugin +${changes.plugin.version} + + + + changes-report + + + + + %URL%/show_bug.cgi?id=%ISSUE% + true + + + +org.apache.maven.plugins +
[1/4] logging-log4j2 git commit: LOG4J2-2076 CouchDB and MongoDB appenders in own modules, remove log4j-nosql module
Repository: logging-log4j2 Updated Branches: refs/heads/LOG4J2-2076 d3f9719f9 -> ebec215eb http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-nosql/src/test/resources/log4j2-mongodb.xml -- diff --git a/log4j-nosql/src/test/resources/log4j2-mongodb.xml b/log4j-nosql/src/test/resources/log4j2-mongodb.xml deleted file mode 100644 index c759054..000 --- a/log4j-nosql/src/test/resources/log4j2-mongodb.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/pom.xml -- diff --git a/pom.xml b/pom.xml index 739c090..3b96fdc 100644 --- a/pom.xml +++ b/pom.xml @@ -1290,7 +1290,8 @@ log4j-samples log4j-osgi log4j-bom -log4j-nosql +log4j-couchdb +log4j-mongodb log4j-cassandra log4j-web log4j-perf http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/src/site/markdown/javadoc.md -- diff --git a/src/site/markdown/javadoc.md b/src/site/markdown/javadoc.md index b2e435f..00cd556 100644 --- a/src/site/markdown/javadoc.md +++ b/src/site/markdown/javadoc.md @@ -44,4 +44,6 @@ Component | Description [Apache Flume Appender](log4j-flume-ng/apidocs/index.html) | An Appender that allows applications to send logging events to Apache Flume Agents. [Log4j JMX GUI](log4j-jmx-gui/apidocs/index.html) | A Java Swing-based client for remotely viewing the status logger and editing the Log4j configuration. [Log4j Web Application Support](log4j-web/apidocs/index.html) | Additional classes that enable multiple configurations within a Servlet Container. -[Log4j NoSQL Support](log4j-nosql/apidocs/index.html) | Additional Appenders for NoSQL databases such as MongoDB and CouchDB. +[Log4j CouchDB Support](log4j-couchdb/apidocs/index.html) | Additional Appender for CouchDB. +[Log4j MongoDB Support](log4j-mongodb/apidocs/index.html) | Additional Appender for MongoDB. +[Log4j Cassandra Support](log4j-cassandra/apidocs/index.html) | Additional Appender for Cassandra. http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/src/site/markdown/maven-artifacts.md.vm -- diff --git a/src/site/markdown/maven-artifacts.md.vm b/src/site/markdown/maven-artifacts.md.vm index 272cf2e..175fb2f 100644 --- a/src/site/markdown/maven-artifacts.md.vm +++ b/src/site/markdown/maven-artifacts.md.vm @@ -224,11 +224,23 @@ to SLF4J. The SLF4J Bridge must NOT be on the class path when this is in use. #dependencies(['log4j-to-slf4j']) -$h3 NoSQL Appenders +$h3 CouchDB -If your configuration uses one of the NoSQL Appenders, then add the following. +If your configuration uses the NoSQL CouchDB appender, then add the following. -#dependencies(['log4j-nosql']) +#dependencies(['log4j-couchdb']) + +$h3 MongoDB + +If your configuration uses the NoSQL MongoDB appender, then add the following. + +#dependencies(['log4j-mongodb']) + +$h3 Cassandra + +If your configuration uses the Cassandra appender, then add the following. + +#dependencies(['log4j-cassandra']) $h3 IO Streams http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/src/site/site.xml -- diff --git a/src/site/site.xml b/src/site/site.xml index 6de65be..d323cd2 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -272,7 +272,9 @@ - + + + http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/src/site/xdoc/runtime-dependencies.xml -- diff --git a/src/site/xdoc/runtime-dependencies.xml b/src/site/xdoc/runtime-dependencies.xml index e319c34..1f66725 100644 --- a/src/site/xdoc/runtime-dependencies.xml +++ b/src/site/xdoc/runtime-dependencies.xml @@ -121,8 +121,13 @@ Automatic Module -log4j-nosql -org.apache.logging.log4j.nosql +log4j-couchdb +org.apache.logging.log4j.couchdb +Automatic Module + + +log4j-mongodb +org.apache.logging.log4j.mongodb Automatic Module @@ -255,11 +260,11 @@ NoSQL Appender with MongoDB provider - MongoDB Java Client driver and Log4j NoSQL library + MongoDB Java Client driver and Log4j MongoDB library NoSQL Appender with Apache CouchDB provider - LightCouch CouchDB client library and Log4j NoSQL library + LightCouch CouchDB client library and Log4j CouchDB library
[4/4] logging-log4j2 git commit: LOG4J2-2076 CouchDB and MongoDB appenders in own modules, remove log4j-nosql module
LOG4J2-2076 CouchDB and MongoDB appenders in own modules, remove log4j-nosql module Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/ebec215e Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/ebec215e Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/ebec215e Branch: refs/heads/LOG4J2-2076 Commit: ebec215eb9604963ff9930252f3013121b4be751 Parents: d3f9719 Author: Mikael StåldalAuthored: Tue Oct 17 22:23:50 2017 +0200 Committer: Mikael Ståldal Committed: Tue Oct 17 22:23:50 2017 +0200 -- log4j-bom/pom.xml | 16 +- .../appender/db/AbstractDatabaseAppender.java | 2 +- .../appender/nosql/AbstractNoSqlConnection.java | 48 +++ .../core/appender/nosql/DefaultNoSqlObject.java | 66 +++ .../core/appender/nosql/NoSqlAppender.java | 96 + .../core/appender/nosql/NoSqlConnection.java| 76 .../appender/nosql/NoSqlDatabaseManager.java| 224 ++ .../log4j/core/appender/nosql/NoSqlObject.java | 63 +++ .../core/appender/nosql/NoSqlProvider.java | 49 +++ .../log4j/core/appender/nosql/package-info.java | 24 ++ .../core/appender/nosql/NoSqlAppenderTest.java | 62 +++ .../nosql/NoSqlDatabaseManagerTest.java | 427 +++ log4j-couchdb/pom.xml | 183 .../appender/couchdb/CouchDbConnection.java | 69 +++ .../nosql/appender/couchdb/CouchDbProvider.java | 161 +++ .../nosql/appender/couchdb/package-info.java| 20 + log4j-couchdb/src/site/markdown/index.md.vm | 48 +++ log4j-couchdb/src/site/site.xml | 52 +++ log4j-distribution/pom.xml | 40 +- log4j-mongodb/pom.xml | 183 .../appender/mongodb/MongoDbConnection.java | 96 + .../nosql/appender/mongodb/MongoDbObject.java | 66 +++ .../nosql/appender/mongodb/MongoDbProvider.java | 351 +++ .../nosql/appender/mongodb/package-info.java| 20 + log4j-mongodb/src/site/markdown/index.md.vm | 48 +++ log4j-mongodb/src/site/site.xml | 52 +++ .../nosql/appender/mongodb/MongoDbAuthTest.java | 40 ++ .../appender/mongodb/MongoDbCappedTest.java | 40 ++ .../nosql/appender/mongodb/MongoDbTest.java | 40 ++ .../src/test/resources/log4j2-mongodb-auth.xml | 30 ++ .../test/resources/log4j2-mongodb-capped.xml| 30 ++ .../src/test/resources/log4j2-mongodb.xml | 30 ++ log4j-nosql/pom.xml | 194 - .../nosql/appender/AbstractNoSqlConnection.java | 48 --- .../nosql/appender/DefaultNoSqlObject.java | 66 --- .../log4j/nosql/appender/NoSqlAppender.java | 106 - .../log4j/nosql/appender/NoSqlConnection.java | 76 .../nosql/appender/NoSqlDatabaseManager.java| 224 -- .../log4j/nosql/appender/NoSqlObject.java | 63 --- .../log4j/nosql/appender/NoSqlProvider.java | 49 --- .../appender/couchdb/CouchDbConnection.java | 69 --- .../nosql/appender/couchdb/CouchDbProvider.java | 161 --- .../nosql/appender/couchdb/package-info.java| 20 - .../appender/mongodb/MongoDbConnection.java | 96 - .../nosql/appender/mongodb/MongoDbObject.java | 66 --- .../nosql/appender/mongodb/MongoDbProvider.java | 351 --- .../nosql/appender/mongodb/package-info.java| 20 - .../log4j/nosql/appender/package-info.java | 34 -- log4j-nosql/src/site/markdown/index.md.vm | 77 log4j-nosql/src/site/site.xml | 52 --- .../log4j/nosql/appender/MongoDbAuthTest.java | 40 -- .../log4j/nosql/appender/MongoDbCappedTest.java | 40 -- .../log4j/nosql/appender/MongoDbTest.java | 40 -- .../log4j/nosql/appender/NoSqlAppenderTest.java | 62 --- .../appender/NoSqlDatabaseManagerTest.java | 427 --- .../src/test/resources/log4j2-mongodb-auth.xml | 30 -- .../test/resources/log4j2-mongodb-capped.xml| 30 -- .../src/test/resources/log4j2-mongodb.xml | 30 -- pom.xml | 3 +- src/site/markdown/javadoc.md| 4 +- src/site/markdown/maven-artifacts.md.vm | 18 +- src/site/site.xml | 4 +- src/site/xdoc/runtime-dependencies.xml | 47 +- 63 files changed, 2790 insertions(+), 2509 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-bom/pom.xml -- diff --git a/log4j-bom/pom.xml b/log4j-bom/pom.xml index 129aa91..96bf601 100644 --- a/log4j-bom/pom.xml +++ b/log4j-bom/pom.xml @@ -84,10 +84,22 @@ log4j-web
[2/4] logging-log4j2 git commit: LOG4J2-2076 CouchDB and MongoDB appenders in own modules, remove log4j-nosql module
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlObject.java -- diff --git a/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlObject.java b/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlObject.java deleted file mode 100644 index 191d1a8..000 --- a/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlObject.java +++ /dev/null @@ -1,63 +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 express or implied. - * See the license for the specific language governing permissions and - * limitations under the license. - */ -package org.apache.logging.log4j.nosql.appender; - -/** - * Represents a simple POJO object inserted into a NoSQL object. - * - * @param Specifies what type of underlying object (such as a MongoDB BasicDBObject) this NoSqlObject wraps. - */ -public interface NoSqlObject { -/** - * Sets the value of a property on this object to a String or primitive. - * - * @param field The name of the property - * @param value The value of the property - */ -void set(String field, Object value); - -/** - * Sets the value of a property on this object to a nested complex object. - * - * @param field The name of the property - * @param value The value of the property - */ -void set(String field, NoSqlObject value); - -/** - * Sets the value of a property on this object to an array of Strings or primitives. - * - * @param field The name of the property - * @param values The values for the property - */ -void set(String field, Object[] values); - -/** - * Sets the value of a property on this object to an array of nested complex objects. - * - * @param field The name of the property - * @param values The values for the property - */ -void set(String field, NoSqlObject[] values); - -/** - * Obtains the underlying NoSQL library-specific object that this object wraps. - * - * @return the wrapped object. - */ -W unwrap(); -} http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebec215e/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlProvider.java -- diff --git a/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlProvider.java b/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlProvider.java deleted file mode 100644 index 75692bd..000 --- a/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlProvider.java +++ /dev/null @@ -1,49 +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 express or implied. - * See the license for the specific language governing permissions and - * limitations under the license. - */ -package org.apache.logging.log4j.nosql.appender; - -/** - * Implementations of this class are plugins for configuring the {@link NoSqlAppender} with the proper provider - * (MongoDB, etc.). - * - * @param Specifies which implementation of {@link NoSqlConnection} this provider provides. - */ -public interface NoSqlProvider>> { - -/** - * Obtains a connection from this provider. The concept of a connection in this case is not strictly an active - * duplex UDP or TCP connection to the underlying database. It can be thought of more as a gateway, a path for - * inserting objects that may use a persistent connection or may use HTTP web service calls, etc. - * - * Where applicable, this method should
[3/3] logging-log4j2 git commit: LOG4J2-2076 Cassandra appender in own module
LOG4J2-2076 Cassandra appender in own module Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d3f9719f Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d3f9719f Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d3f9719f Branch: refs/heads/LOG4J2-2076 Commit: d3f9719f9434abb82ec06c7c4eefc06c72d710bf Parents: ff5e664 Author: Mikael StåldalAuthored: Mon Oct 16 22:01:28 2017 +0200 Committer: Mikael Ståldal Committed: Mon Oct 16 22:03:33 2017 +0200 -- log4j-cassandra/pom.xml | 200 .../appender/cassandra/CassandraAppender.java | 185 .../appender/cassandra/CassandraManager.java| 218 + .../cassandra/ClockTimestampGenerator.java | 34 + .../nosql/appender/cassandra/package-info.java | 23 + log4j-cassandra/src/site/markdown/index.md.vm | 24 + log4j-cassandra/src/site/site.xml | 52 ++ .../appender/cassandra/CassandraAppenderIT.java | 96 ++ .../nosql/appender/cassandra/CassandraRule.java | 141 +++ .../test/resources/CassandraAppenderTest.xml| 40 + .../src/test/resources/cassandra.yaml | 901 +++ log4j-nosql/pom.xml | 19 +- .../appender/cassandra/CassandraAppender.java | 185 .../appender/cassandra/CassandraManager.java| 218 - .../cassandra/ClockTimestampGenerator.java | 34 - .../nosql/appender/cassandra/package-info.java | 23 - log4j-nosql/src/site/markdown/index.md.vm | 2 - .../appender/cassandra/CassandraAppenderIT.java | 96 -- .../nosql/appender/cassandra/CassandraRule.java | 141 --- .../test/resources/CassandraAppenderTest.xml| 40 - log4j-nosql/src/test/resources/cassandra.yaml | 901 --- pom.xml | 1 + src/site/xdoc/runtime-dependencies.xml | 14 +- 23 files changed, 1929 insertions(+), 1659 deletions(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d3f9719f/log4j-cassandra/pom.xml -- diff --git a/log4j-cassandra/pom.xml b/log4j-cassandra/pom.xml new file mode 100644 index 000..9fab242 --- /dev/null +++ b/log4j-cassandra/pom.xml @@ -0,0 +1,200 @@ + + + +http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> + +org.apache.logging.log4j +log4j +2.10.0-SNAPSHOT + + 4.0.0 + + log4j-cassandra + Apache Log4j Cassandra + +Cassandra appender for Log4j. + + +${basedir}/.. +Cassandra Documentation +/log4j-cassandra +org.apache.logging.log4j.cassandra + + + + + org.apache.logging.log4j + log4j-core + + + com.datastax.cassandra + cassandra-driver-core + + + + junit + junit + + + org.mockito + mockito-core + test + + + org.apache.logging.log4j + log4j-api + test-jar + + + org.apache.logging.log4j + log4j-core + test-jar + + + + org.apache.cassandra + cassandra-all + 2.2.8 + test + + + ch.qos.logback + logback-classic + + + ch.qos.logback + logback-core + + + + + org.apache.logging.log4j + log4j-slf4j-impl + test + + + + + + +org.apache.felix +maven-bundle-plugin + + +org.apache.logging.log4j.core +* + + + + + + + + +org.apache.maven.plugins +maven-changes-plugin +${changes.plugin.version} + + + + changes-report + + + + + %URL%/show_bug.cgi?id=%ISSUE% + true + + + +org.apache.maven.plugins +maven-checkstyle-plugin +${checkstyle.plugin.version} + + + ${log4jParentDir}/checkstyle.xml + ${log4jParentDir}/checkstyle-suppressions.xml + false + basedir=${basedir} + licensedir=${log4jParentDir}/checkstyle-header.txt + + + +org.apache.maven.plugins +maven-javadoc-plugin +${javadoc.plugin.version} + + + + false + true + + + +non-aggregate + + javadoc + + + + + +org.codehaus.mojo +findbugs-maven-plugin +
[1/3] logging-log4j2 git commit: LOG4J2-2076 Cassandra appender in own module
Repository: logging-log4j2 Updated Branches: refs/heads/LOG4J2-2076 [created] d3f9719f9 http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d3f9719f/log4j-nosql/src/test/resources/cassandra.yaml -- diff --git a/log4j-nosql/src/test/resources/cassandra.yaml b/log4j-nosql/src/test/resources/cassandra.yaml deleted file mode 100644 index 356e43d..000 --- a/log4j-nosql/src/test/resources/cassandra.yaml +++ /dev/null @@ -1,901 +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 express or implied. -# See the license for the specific language governing permissions and -# limitations under the license. - -# Cassandra storage config YAML - -# NOTE: -# See http://wiki.apache.org/cassandra/StorageConfiguration for -# full explanations of configuration directives -# /NOTE - -# The name of the cluster. This is mainly used to prevent machines in -# one logical cluster from joining another. -cluster_name: 'Test Cluster' - -# This defines the number of tokens randomly assigned to this node on the ring -# The more tokens, relative to other nodes, the larger the proportion of data -# that this node will store. You probably want all nodes to have the same number -# of tokens assuming they have equal hardware capability. -# -# If you leave this unspecified, Cassandra will use the default of 1 token for legacy compatibility, -# and will use the initial_token as described below. -# -# Specifying initial_token will override this setting on the node's initial start, -# on subsequent starts, this setting will apply even if initial token is set. -# -# If you already have a cluster with 1 token per node, and wish to migrate to -# multiple tokens per node, see http://wiki.apache.org/cassandra/Operations -num_tokens: 256 - -# initial_token allows you to specify tokens manually. While you can use # it with -# vnodes (num_tokens > 1, above) -- in which case you should provide a -# comma-separated list -- it's primarily used when adding nodes # to legacy clusters -# that do not have vnodes enabled. -# initial_token: - -# See http://wiki.apache.org/cassandra/HintedHandoff -# May either be "true" or "false" to enable globally, or contain a list -# of data centers to enable per-datacenter. -# hinted_handoff_enabled: DC1,DC2 -hinted_handoff_enabled: true -# this defines the maximum amount of time a dead host will have hints -# generated. After it has been dead this long, new hints for it will not be -# created until it has been seen alive and gone down again. -max_hint_window_in_ms: 1080 # 3 hours -# Maximum throttle in KBs per second, per delivery thread. This will be -# reduced proportionally to the number of nodes in the cluster. (If there -# are two nodes in the cluster, each delivery thread will use the maximum -# rate; if there are three, each will throttle to half of the maximum, -# since we expect two nodes to be delivering hints simultaneously.) -hinted_handoff_throttle_in_kb: 1024 -# Number of threads with which to deliver hints; -# Consider increasing this number when you have multi-dc deployments, since -# cross-dc handoff tends to be slower -max_hints_delivery_threads: 2 - -# Maximum throttle in KBs per second, total. This will be -# reduced proportionally to the number of nodes in the cluster. -batchlog_replay_throttle_in_kb: 1024 - -# Authentication backend, implementing IAuthenticator; used to identify users -# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthenticator, -# PasswordAuthenticator}. -# -# - AllowAllAuthenticator performs no checks - set it to disable authentication. -# - PasswordAuthenticator relies on username/password pairs to authenticate -# users. It keeps usernames and hashed passwords in system_auth.credentials table. -# Please increase system_auth keyspace replication factor if you use this authenticator. -# If using PasswordAuthenticator, CassandraRoleManager must also be used (see below) -authenticator: AllowAllAuthenticator - -# Authorization backend, implementing IAuthorizer; used to limit access/provide permissions -# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthorizer, -# CassandraAuthorizer}. -# -# - AllowAllAuthorizer allows any action to any user - set it to disable authorization. -# - CassandraAuthorizer stores
[3/4] logging-log4j2 git commit: LOG4J2-2062 Fix formatting
LOG4J2-2062 Fix formatting Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d93fad11 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d93fad11 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d93fad11 Branch: refs/heads/master Commit: d93fad115745bb10cd0d99c4a16dee22fe640906 Parents: 67fe389 Author: Mikael StåldalAuthored: Mon Oct 16 20:53:23 2017 +0200 Committer: Mikael Ståldal Committed: Mon Oct 16 20:53:23 2017 +0200 -- .../apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java | 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d93fad11/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java -- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java index d98d5b3..9af11cd 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java @@ -102,7 +102,6 @@ public class KafkaManager extends AbstractManager { public void send(final byte[] msg) throws ExecutionException, InterruptedException, TimeoutException { if (producer != null) { - byte[] newKey = null; if(key != null && key.contains("${")) {