You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by mi...@apache.org on 2016/08/03 11:33:51 UTC

[01/28] logging-log4j2 git commit: Remove extra blank line.

Repository: logging-log4j2
Updated Branches:
  refs/heads/LOG4J-1181 de52134db -> 2e5b25919


Remove extra blank line.

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

Branch: refs/heads/LOG4J-1181
Commit: 0116c0c2bffcf67ffad1540ee2d885814cc01398
Parents: dcade9e
Author: Gary Gregory <gg...@apache.org>
Authored: Tue Jul 26 13:26:59 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Tue Jul 26 13:26:59 2016 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/logging/log4j/core/util/Loader.java    | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0116c0c2/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Loader.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Loader.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Loader.java
index 9f402cd..dfaf78c 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Loader.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Loader.java
@@ -16,7 +16,6 @@
  */
 package org.apache.logging.log4j.core.util;
 
-
 import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
 import java.net.URL;


[03/28] logging-log4j2 git commit: Add missing '@Override' annotations.

Posted by mi...@apache.org.
Add missing '@Override' annotations.

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

Branch: refs/heads/LOG4J-1181
Commit: 47918385575f40e250cb305d39ae8cc63642f49d
Parents: 8b569ca
Author: Gary Gregory <gg...@apache.org>
Authored: Tue Jul 26 16:58:51 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Tue Jul 26 16:58:51 2016 -0700

----------------------------------------------------------------------
 .../org/apache/logging/log4j/core/pattern/NameAbbreviator.java     | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/47918385/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/NameAbbreviator.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/NameAbbreviator.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/NameAbbreviator.java
index bb43d9e..4cd28fb 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/NameAbbreviator.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/NameAbbreviator.java
@@ -176,6 +176,7 @@ public abstract class NameAbbreviator {
          */
         private enum Strategy {
             DROP(0) {
+                @Override
                 void abbreviate(final int count, final String original, final StringBuilder destination) {
                     // If a path does not contain enough path elements to drop, none will be dropped.
                     int start = 0;
@@ -192,6 +193,7 @@ public abstract class NameAbbreviator {
                 }
             },
             RETAIN(1) {
+                @Override
                 void abbreviate(final int count, final String original, final StringBuilder destination) {
                     // We subtract 1 from 'len' when assigning to 'end' to avoid out of
                     // bounds exception in return r.substring(end+1, len). This can happen if


[14/28] logging-log4j2 git commit: This closes #34

Posted by mi...@apache.org.
This closes #34


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

Branch: refs/heads/LOG4J-1181
Commit: 907f341cf47d148854a8f7f8a532942691a5be34
Parents: efd9028
Author: rpopma <rp...@apache.org>
Authored: Sun Jul 31 14:49:29 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Jul 31 14:49:29 2016 +0900

----------------------------------------------------------------------

----------------------------------------------------------------------



[09/28] logging-log4j2 git commit: Add toString().

Posted by mi...@apache.org.
Add toString().

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

Branch: refs/heads/LOG4J-1181
Commit: 7694f141bae4e44f70be43cde5be383aa7561d9f
Parents: 83dda19
Author: Gary Gregory <gg...@apache.org>
Authored: Thu Jul 28 17:33:21 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu Jul 28 17:33:21 2016 -0700

----------------------------------------------------------------------
 .../logging/log4j/junit/BundleTestInfo.java     | 137 ++++++++++---------
 1 file changed, 71 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7694f141/log4j-api/src/test/java/org/apache/logging/log4j/junit/BundleTestInfo.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/junit/BundleTestInfo.java b/log4j-api/src/test/java/org/apache/logging/log4j/junit/BundleTestInfo.java
index e8ed0a8..7cdf468 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/junit/BundleTestInfo.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/junit/BundleTestInfo.java
@@ -1,66 +1,71 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.junit;
-
-import java.io.FileReader;
-import java.io.IOException;
-
-import org.apache.maven.model.Model;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
-/**
- * Provides tests with bundle information. Reads the {@code pom.xml} in the current directory to get project settings.
- */
-public class BundleTestInfo {
-
-    private final MavenProject project;
-
-    /**
-     * Constructs a new helper objects and initializes itself.
-     */
-    public BundleTestInfo() {
-        try (final FileReader reader = new FileReader("pom.xml")) {
-            // get a raw POM view, not a fully realized POM object.
-            final Model model = new MavenXpp3Reader().read(reader);
-            this.project = new MavenProject(model);
-        } catch (final IOException | XmlPullParserException e) {
-            throw new IllegalStateException("Could not read pom.xml", e);
-        }
-    }
-
-    /**
-     * Gets the Maven artifact ID.
-     *
-     * @return the Maven artifact ID.
-     */
-    public String getArtifactId() {
-        return project.getArtifactId();
-    }
-
-    /**
-     * Gets the Maven version String.
-     *
-     * @return the Maven version String.
-     */
-    public String getVersion() {
-        return project.getVersion();
-    }
-
-}
+/*
+ * 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.junit;
+
+import java.io.FileReader;
+import java.io.IOException;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+/**
+ * Provides tests with bundle information. Reads the {@code pom.xml} in the current directory to get project settings.
+ */
+public class BundleTestInfo {
+
+    private final MavenProject project;
+
+    /**
+     * Constructs a new helper objects and initializes itself.
+     */
+    public BundleTestInfo() {
+        try (final FileReader reader = new FileReader("pom.xml")) {
+            // get a raw POM view, not a fully realized POM object.
+            final Model model = new MavenXpp3Reader().read(reader);
+            this.project = new MavenProject(model);
+        } catch (final IOException | XmlPullParserException e) {
+            throw new IllegalStateException("Could not read pom.xml", e);
+        }
+    }
+
+    /**
+     * Gets the Maven artifact ID.
+     *
+     * @return the Maven artifact ID.
+     */
+    public String getArtifactId() {
+        return project.getArtifactId();
+    }
+
+    /**
+     * Gets the Maven version String.
+     *
+     * @return the Maven version String.
+     */
+    public String getVersion() {
+        return project.getVersion();
+    }
+
+    @Override
+    public String toString() {
+        return "BundleTestInfo [project=" + project + "]";
+    }
+
+}


[25/28] logging-log4j2 git commit: LOG4J2-1488 added support for ISO8601_BASIC_PERIOD.

Posted by mi...@apache.org.
LOG4J2-1488 added support for ISO8601_BASIC_PERIOD.

This closes #35 (https://github.com/apache/logging-log4j2/pull/35).


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

Branch: refs/heads/LOG4J-1181
Commit: 641014d17ac8296a6925d828f74c958c8f587725
Parents: d2e5304
Author: rpopma <rp...@apache.org>
Authored: Tue Aug 2 00:01:59 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Tue Aug 2 00:01:59 2016 +0900

----------------------------------------------------------------------
 .../log4j/core/util/datetime/FixedDateFormat.java        |  5 +++++
 .../log4j/core/pattern/DatePatternConverterTest.java     | 11 +++++++++++
 2 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/641014d1/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
index 7232b14..cded615 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
@@ -76,6 +76,11 @@ public class FixedDateFormat {
         ISO8601_BASIC("yyyyMMdd'T'HHmmss,SSS", "yyyyMMdd'T'", 2, ' ', 0, ',', 1),
 
         /**
+         * ISO8601_BASIC time format: {@code "yyyyMMdd'T'HHmmss.SSS"}.
+         */
+        ISO8601_BASIC_PERIOD("yyyyMMdd'T'HHmmss.SSS", "yyyyMMdd'T'", 2, ' ', 0, '.', 1),
+
+        /**
          * ISO8601 time format: {@code "yyyy-MM-dd'T'HH:mm:ss,SSS"}.
          */
         ISO8601("yyyy-MM-dd'T'HH:mm:ss,SSS", "yyyy-MM-dd'T'", 2, ':', 1, ',', 1),

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/641014d1/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java
index 5dc6084..9f55165 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java
@@ -202,6 +202,17 @@ public class DatePatternConverterTest {
     }
 
     @Test
+    public void testFormatDateStringBuilderIso8601BasicWithPeriod() {
+        final String[] pattern = {FixedDateFormat.FixedFormat.ISO8601_BASIC_PERIOD.name()};
+        final DatePatternConverter converter = DatePatternConverter.newInstance(pattern);
+        final StringBuilder sb = new StringBuilder();
+        converter.format(date(2001, 1, 1), sb);
+
+        final String expected = "20010201T141516.123";
+        assertEquals(expected, sb.toString());
+    }
+
+    @Test
     public void testFormatDateStringBuilderOriginalPattern() {
         final String[] pattern = {"yyyy/MM/dd HH-mm-ss.SSS"};
         final DatePatternConverter converter = DatePatternConverter.newInstance(pattern);


[15/28] logging-log4j2 git commit: LOG4J2-1279 Prevent NullPointerException in FastDateParser$TimeZoneStrategy.

Posted by mi...@apache.org.
LOG4J2-1279 Prevent NullPointerException in FastDateParser$TimeZoneStrategy.

This closes #24 (https://github.com/apache/logging-log4j2/pull/24).


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

Branch: refs/heads/LOG4J-1181
Commit: 2f38e4f622ab03228bda3b1c2f68aa4d58ff9b22
Parents: 907f341
Author: rpopma <rp...@apache.org>
Authored: Sun Jul 31 15:12:48 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Jul 31 15:12:48 2016 +0900

----------------------------------------------------------------------
 .../core/util/datetime/FastDateParser.java      | 54 +++++++++++---------
 src/changes/changes.xml                         |  3 ++
 2 files changed, 32 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2f38e4f6/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateParser.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateParser.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateParser.java
index c5f9fdc..7c21aed 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateParser.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateParser.java
@@ -119,7 +119,7 @@ public class FastDateParser implements DateParser, Serializable {
      * <p>
      * Constructs a new FastDateParser.
      * </p>
-     * 
+     *
      * Use {@link FastDateFormat#getInstance(String, TimeZone, Locale)} or another variation of the factory methods of
      * {@link FastDateFormat} to get a cached FastDateParser instance.
      *
@@ -236,7 +236,7 @@ public class FastDateParser implements DateParser, Serializable {
     // -----------------------------------------------------------------------
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.apache.commons.lang3.time.DateParser#getPattern()
      */
     @Override
@@ -246,7 +246,7 @@ public class FastDateParser implements DateParser, Serializable {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.apache.commons.lang3.time.DateParser#getTimeZone()
      */
     @Override
@@ -256,7 +256,7 @@ public class FastDateParser implements DateParser, Serializable {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.apache.commons.lang3.time.DateParser#getLocale()
      */
     @Override
@@ -334,7 +334,7 @@ public class FastDateParser implements DateParser, Serializable {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.apache.commons.lang3.time.DateParser#parseObject(java.lang.String)
      */
     @Override
@@ -344,7 +344,7 @@ public class FastDateParser implements DateParser, Serializable {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.apache.commons.lang3.time.DateParser#parse(java.lang.String)
      */
     @Override
@@ -363,7 +363,7 @@ public class FastDateParser implements DateParser, Serializable {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.apache.commons.lang3.time.DateParser#parseObject(java.lang.String, java.text.ParsePosition)
      */
     @Override
@@ -431,7 +431,7 @@ public class FastDateParser implements DateParser, Serializable {
 
     /**
      * Escape constant fields into regular expression
-     * 
+     *
      * @param regex The destination regex
      * @param value The source field
      * @param unquote If true, replace two success quotes ('') with single quote (')
@@ -457,7 +457,7 @@ public class FastDateParser implements DateParser, Serializable {
                 /*
                  * If we have found \E, we replace it with \E\\E\Q, i.e. we stop the quoting, quote the \ in \E, then
                  * restart the quoting.
-                 * 
+                 *
                  * Otherwise we just output the two characters. In each case the initial \ needs to be output and the
                  * final char is done at the end
                  */
@@ -479,7 +479,7 @@ public class FastDateParser implements DateParser, Serializable {
 
     /**
      * Get the short and long values displayed for a field
-     * 
+     *
      * @param field The field of interest
      * @param definingCalendar The calendar to obtain the short and long values
      * @param locale The locale of display names
@@ -492,7 +492,7 @@ public class FastDateParser implements DateParser, Serializable {
 
     /**
      * Adjust dates to be within appropriate century
-     * 
+     *
      * @param twoDigitYear The year to adjust
      * @return A value between centuryStart(inclusive) to centuryStart+100(exclusive)
      */
@@ -503,7 +503,7 @@ public class FastDateParser implements DateParser, Serializable {
 
     /**
      * Is the next field a number?
-     * 
+     *
      * @return true, if next field will be a number
      */
     boolean isNextNumber() {
@@ -512,7 +512,7 @@ public class FastDateParser implements DateParser, Serializable {
 
     /**
      * What is the width of the current field?
-     * 
+     *
      * @return The number of characters in the current format field
      */
     int getFieldWidth() {
@@ -549,7 +549,7 @@ public class FastDateParser implements DateParser, Serializable {
         /**
          * Generate a <code>Pattern</code> regular expression to the <code>StringBuilder</code> which will accept this
          * field
-         * 
+         *
          * @param parser The parser calling this strategy
          * @param regex The <code>StringBuilder</code> to append to
          * @return true, if this field will set the calendar; false, if this field is a constant value
@@ -566,7 +566,7 @@ public class FastDateParser implements DateParser, Serializable {
 
     /**
      * Obtain a Strategy given a field from a SimpleDateFormat pattern
-     * 
+     *
      * @param formatField A sub-sequence of the SimpleDateFormat pattern
      * @param definingCalendar The calendar to obtain the short and long values
      * @return The Strategy that will handle parsing for the field
@@ -635,7 +635,7 @@ public class FastDateParser implements DateParser, Serializable {
 
     /**
      * Get a cache of Strategies for a particular field
-     * 
+     *
      * @param field The Calendar field
      * @return a cache of Locale to Strategy
      */
@@ -650,7 +650,7 @@ public class FastDateParser implements DateParser, Serializable {
 
     /**
      * Construct a Strategy that parses a Text field
-     * 
+     *
      * @param field The Calendar field
      * @param definingCalendar The calendar to obtain the short and long values
      * @return a TextStrategy for the field and Locale
@@ -677,7 +677,7 @@ public class FastDateParser implements DateParser, Serializable {
 
         /**
          * Construct a Strategy that ensures the formatField has literal text
-         * 
+         *
          * @param formatField The literal text to match
          */
         CopyQuotedStrategy(final String formatField) {
@@ -716,7 +716,7 @@ public class FastDateParser implements DateParser, Serializable {
 
         /**
          * Construct a Strategy that parses a Text field
-         * 
+         *
          * @param field The Calendar field
          * @param definingCalendar The Calendar to use
          * @param locale The Locale to use
@@ -772,7 +772,7 @@ public class FastDateParser implements DateParser, Serializable {
 
         /**
          * Construct a Strategy that parses a Number field
-         * 
+         *
          * @param field The Calendar field
          */
         NumberStrategy(final int field) {
@@ -811,7 +811,7 @@ public class FastDateParser implements DateParser, Serializable {
 
         /**
          * Make any modifications to parsed integer
-         * 
+         *
          * @param iValue The parsed integer
          * @return The modified value
          */
@@ -838,7 +838,7 @@ public class FastDateParser implements DateParser, Serializable {
 
         /**
          * Construct a Strategy that parses a TimeZone
-         * 
+         *
          * @param locale The Locale
          */
         TimeZoneStrategy(final Locale locale) {
@@ -855,7 +855,11 @@ public class FastDateParser implements DateParser, Serializable {
                 }
                 final TimeZone tz = TimeZone.getTimeZone(tzId);
                 for (int i = 1; i < zoneNames.length; ++i) {
-                    final String zoneName = zoneNames[i].toLowerCase(locale);
+                    final String currentZoneName = zoneNames[i];
+                    if (currentZoneName == null) {
+                        continue;
+                    }
+                    final String zoneName = currentZoneName.toLowerCase(locale);
                     if (!tzNames.containsKey(zoneName)) {
                         tzNames.put(zoneName, tz);
                         simpleQuote(sb.append('|'), zoneName);
@@ -902,7 +906,7 @@ public class FastDateParser implements DateParser, Serializable {
 
         /**
          * Construct a Strategy that parses a TimeZone
-         * 
+         *
          * @param pattern The Pattern
          */
         ISO8601TimeZoneStrategy(final String pattern) {
@@ -936,7 +940,7 @@ public class FastDateParser implements DateParser, Serializable {
 
         /**
          * Factory method for ISO8601TimeZoneStrategies.
-         * 
+         *
          * @param tokenLen a token indicating the length of the TimeZone String to be formatted.
          * @return a ISO8601TimeZoneStrategy that can format TimeZone String of length {@code tokenLen}. If no such
          *         strategy exists, an IllegalArgumentException will be thrown.

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2f38e4f6/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 25d4b07..e4b4bee 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -24,6 +24,9 @@
   </properties>
   <body>
     <release version="2.7" date="2016-MM-DD" description="GA Release 2.7.0">
+      <action issue="LOG4J2-1279" dev="rpopma" type="fix" due-to="Tony Baines">
+        Prevent NullPointerException in FastDateParser$TimeZoneStrategy.
+      </action>
       <action issue="LOG4J2-1341" dev="rpopma" type="fix" due-to="Richard Zschech">
         (GC) HighlightConverter and StyleConverter are now GC-free.
       </action>


[04/28] logging-log4j2 git commit: Remove unused imports.

Posted by mi...@apache.org.
Remove unused imports.

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

Branch: refs/heads/LOG4J-1181
Commit: 8fc1477eadac445141a50f0efce8ba2d02762f64
Parents: 4791838
Author: Gary Gregory <gg...@apache.org>
Authored: Tue Jul 26 17:00:12 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Tue Jul 26 17:00:12 2016 -0700

----------------------------------------------------------------------
 .../src/test/java/org/apache/logging/log4j/TraceLoggingTest.java   | 1 -
 .../log4j/core/appender/rolling/action/FileRenameAction.java       | 1 -
 .../org/apache/logging/log4j/core/pattern/JAnsiTextRenderer.java   | 2 --
 3 files changed, 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8fc1477e/log4j-api/src/test/java/org/apache/logging/log4j/TraceLoggingTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/TraceLoggingTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/TraceLoggingTest.java
index 693a174..0dce612 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/TraceLoggingTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/TraceLoggingTest.java
@@ -24,7 +24,6 @@ import org.apache.logging.log4j.message.ObjectMessage;
 import org.apache.logging.log4j.message.ParameterizedMessage;
 import org.apache.logging.log4j.message.ReusableParameterizedMessage;
 import org.apache.logging.log4j.message.ReusableParameterizedMessageTest;
-import org.apache.logging.log4j.message.ReusableSimpleMessage;
 import org.apache.logging.log4j.message.SimpleMessage;
 import org.apache.logging.log4j.spi.AbstractLogger;
 import org.junit.Test;

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8fc1477e/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/FileRenameAction.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/FileRenameAction.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/FileRenameAction.java
index 023c869..0ad35af 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/FileRenameAction.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/FileRenameAction.java
@@ -20,7 +20,6 @@ import java.io.File;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.nio.file.Files;
-import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.nio.file.StandardCopyOption;
 

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8fc1477e/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiTextRenderer.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiTextRenderer.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiTextRenderer.java
index 1b65b48..b9ac604 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiTextRenderer.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiTextRenderer.java
@@ -18,8 +18,6 @@ package org.apache.logging.log4j.core.pattern;
 
 import static org.fusesource.jansi.AnsiRenderer.Code.BG_RED;
 import static org.fusesource.jansi.AnsiRenderer.Code.BOLD;
-import static org.fusesource.jansi.AnsiRenderer.Code.CYAN;
-import static org.fusesource.jansi.AnsiRenderer.Code.GREEN;
 import static org.fusesource.jansi.AnsiRenderer.Code.RED;
 import static org.fusesource.jansi.AnsiRenderer.Code.WHITE;
 import static org.fusesource.jansi.AnsiRenderer.Code.YELLOW;


[24/28] logging-log4j2 git commit: LOG4J2-1341 make HighlightConverter change consistent with StyleConverter

Posted by mi...@apache.org.
LOG4J2-1341 make HighlightConverter change consistent with StyleConverter


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

Branch: refs/heads/LOG4J-1181
Commit: d2e53042783924d6148afa9aa78fe7408ea953e7
Parents: 4bcd749
Author: rpopma <rp...@apache.org>
Authored: Mon Aug 1 23:54:22 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Mon Aug 1 23:54:22 2016 +0900

----------------------------------------------------------------------
 .../org/apache/logging/log4j/core/pattern/HighlightConverter.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d2e53042/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
index c0ab673..beea9bd 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
@@ -216,9 +216,10 @@ public final class HighlightConverter extends LogEventPatternConverter implement
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        final int start = toAppendTo.length();
+        int start = 0;
         int end = 0;
         if (!noAnsi) { // use ANSI: set prefix
+            start = toAppendTo.length();
             toAppendTo.append(levelStyles.get(event.getLevel()));
             end = toAppendTo.length();
         }


[16/28] logging-log4j2 git commit: Made description consistent with previous releases.

Posted by mi...@apache.org.
Made description consistent with previous releases.


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

Branch: refs/heads/LOG4J-1181
Commit: 2bca903534f879628fb54abbbb435de764a37c17
Parents: 2f38e4f
Author: rpopma <rp...@apache.org>
Authored: Sun Jul 31 15:14:05 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Jul 31 15:14:05 2016 +0900

----------------------------------------------------------------------
 src/changes/changes.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2bca9035/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index e4b4bee..cbb8466 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -23,7 +23,7 @@
     <title>Changes</title>
   </properties>
   <body>
-    <release version="2.7" date="2016-MM-DD" description="GA Release 2.7.0">
+    <release version="2.7" date="2016-MM-DD" description="GA Release 2.7">
       <action issue="LOG4J2-1279" dev="rpopma" type="fix" due-to="Tony Baines">
         Prevent NullPointerException in FastDateParser$TimeZoneStrategy.
       </action>


[26/28] logging-log4j2 git commit: Add missing @since 2.6.

Posted by mi...@apache.org.
Add missing @since 2.6.

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

Branch: refs/heads/LOG4J-1181
Commit: 7ca4dfecfb8890b02f401aa33bd96bff01bac90d
Parents: 641014d
Author: Gary Gregory <gg...@apache.org>
Authored: Tue Aug 2 08:36:50 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Tue Aug 2 08:36:50 2016 -0700

----------------------------------------------------------------------
 log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7ca4dfec/log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java
index acf154c..bb59d46 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/Unbox.java
@@ -43,6 +43,7 @@ import org.apache.logging.log4j.status.StatusLogger;
  * If more slots are required, set system property {@code log4j.unbox.ringbuffer.size} to the desired ring buffer size.
  * Note that the specified number will be rounded up to the nearest power of 2.
  * </p>
+ * @since 2.6
  */
 @PerformanceSensitive("allocation")
 public class Unbox {


[13/28] logging-log4j2 git commit: This closes #7

Posted by mi...@apache.org.
This closes #7


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

Branch: refs/heads/LOG4J-1181
Commit: efd90289139439653d7dfdf94fffa2342e78d7ca
Parents: c4af088
Author: rpopma <rp...@apache.org>
Authored: Sun Jul 31 14:48:51 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Jul 31 14:48:51 2016 +0900

----------------------------------------------------------------------

----------------------------------------------------------------------



[18/28] logging-log4j2 git commit: LOG4J2-1488 (GC) Fixed ISO8601 %date conversion pattern with a period '.' separator for milliseconds is now garbage free.

Posted by mi...@apache.org.
LOG4J2-1488 (GC) Fixed ISO8601 %date conversion pattern with a period '.' separator for milliseconds is now garbage free.

This closes #35 (https://github.com/apache/logging-log4j2/pull/35).


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

Branch: refs/heads/LOG4J-1181
Commit: 291fbf007962c48afb2c86d772a596c4d29a9cf8
Parents: 0a85a77
Author: rpopma <rp...@apache.org>
Authored: Sun Jul 31 15:53:54 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Jul 31 15:53:54 2016 +0900

----------------------------------------------------------------------
 .../log4j/core/util/datetime/FixedDateFormat.java        |  7 ++++++-
 .../log4j/core/pattern/DatePatternConverterTest.java     | 11 +++++++++++
 log4j-core/src/test/resources/gcFreeLogging.xml          |  4 ++--
 .../src/test/resources/gcFreeMixedSyncAsyncLogging.xml   |  4 ++--
 src/changes/changes.xml                                  |  3 +++
 5 files changed, 24 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/291fbf00/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
index 3b1f102..7232b14 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
@@ -78,7 +78,12 @@ public class FixedDateFormat {
         /**
          * ISO8601 time format: {@code "yyyy-MM-dd'T'HH:mm:ss,SSS"}.
          */
-        ISO8601("yyyy-MM-dd'T'HH:mm:ss,SSS", "yyyy-MM-dd'T'", 2, ':', 1, ',', 1);
+        ISO8601("yyyy-MM-dd'T'HH:mm:ss,SSS", "yyyy-MM-dd'T'", 2, ':', 1, ',', 1),
+
+        /**
+         * ISO8601 time format: {@code "yyyy-MM-dd'T'HH:mm:ss.SSS"}.
+         */
+        ISO8601_PERIOD("yyyy-MM-dd'T'HH:mm:ss.SSS", "yyyy-MM-dd'T'", 2, ':', 1, '.', 1);
 
         private final String pattern;
         private final String datePattern;

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/291fbf00/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java
index 4a5669c..5dc6084 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/DatePatternConverterTest.java
@@ -191,6 +191,17 @@ public class DatePatternConverterTest {
     }
 
     @Test
+    public void testFormatDateStringBuilderIso8601WithPeriod() {
+        final String[] pattern = {FixedDateFormat.FixedFormat.ISO8601_PERIOD.name()};
+        final DatePatternConverter converter = DatePatternConverter.newInstance(pattern);
+        final StringBuilder sb = new StringBuilder();
+        converter.format(date(2001, 1, 1), sb);
+
+        final String expected = "2001-02-01T14:15:16.123";
+        assertEquals(expected, sb.toString());
+    }
+
+    @Test
     public void testFormatDateStringBuilderOriginalPattern() {
         final String[] pattern = {"yyyy/MM/dd HH-mm-ss.SSS"};
         final DatePatternConverter converter = DatePatternConverter.newInstance(pattern);

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/291fbf00/log4j-core/src/test/resources/gcFreeLogging.xml
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/resources/gcFreeLogging.xml b/log4j-core/src/test/resources/gcFreeLogging.xml
index 97fc345..d4b597f 100644
--- a/log4j-core/src/test/resources/gcFreeLogging.xml
+++ b/log4j-core/src/test/resources/gcFreeLogging.xml
@@ -12,7 +12,7 @@
     <RollingFile name="RollingFile" fileName="target/gcfreeRollingFile.log"
         filePattern="target/gcfree-%d{MM-dd-yy-HH-mm-ss}.log.gz">
       <PatternLayout>
-        <Pattern>%d{DEFAULT}{UTC} %p %c{1.} [%t] %m%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
+        <Pattern>%d{yyyy-MM-dd'T'HH:mm:ss,SSS}{UTC} %p %c{1.} [%t] %m%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
       </PatternLayout>
       <Policies>
         <SizeBasedTriggeringPolicy size="50M" />
@@ -20,7 +20,7 @@
     </RollingFile>
     <RandomAccessFile name="RandomAccessFile" fileName="target/gcfreeRAF.log" immediateFlush="false" append="false">
       <PatternLayout>
-        <Pattern>%d{DEFAULT}{UTC} %p %c{1.} [%t] %X{aKey} %m %ex%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m %ex%n}</Pattern>
+        <Pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSS}{UTC} %p %c{1.} [%t] %X{aKey} %m %ex%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m %ex%n}</Pattern>
       </PatternLayout>
     </RandomAccessFile>
     <RollingRandomAccessFile name="RollingRandomAccessFile"

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/291fbf00/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml b/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml
index 6944e36..f1937be 100644
--- a/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml
+++ b/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml
@@ -6,13 +6,13 @@
     </Console>
     <File name="File" fileName="target/gcfreefileMixed.log" bufferedIO="false">
       <PatternLayout>
-        <Pattern>%d{DEFAULT}{UTC} %p %c{1.} [%t] %m%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
+        <Pattern>%d{yyyy-MM-dd'T'HH:mm:ss,SSS}{UTC} %p %c{1.} [%t] %m%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
       </PatternLayout>
     </File>
     <RollingFile name="RollingFile" fileName="target/gcfreeRollingFileMixed.log"
         filePattern="target/gcfree-%d{MM-dd-yy-HH-mm-ss}.log.gz">
       <PatternLayout>
-        <Pattern>%d{DEFAULT}{UTC} %p %c{1.} [%t] %m%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
+        <Pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSS}{UTC} %p %c{1.} [%t] %m%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
       </PatternLayout>
       <Policies>
         <SizeBasedTriggeringPolicy size="50M" />

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/291fbf00/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 7e44b1b..efd8e52 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -24,6 +24,9 @@
   </properties>
   <body>
     <release version="2.7" date="2016-MM-DD" description="GA Release 2.7">
+      <action issue="LOG4J2-1488" dev="rpopma" type="fix" due-to="Richard Zschech">
+        (GC) Fixed ISO8601 %date conversion pattern with a period '.' separator for milliseconds is now garbage free.
+      </action>
       <action issue="LOG4J2-1489" dev="rpopma" type="fix" due-to="Richard Zschech">
         (GC) Fixed %date conversion patterns with a timezone parameter are now garbage free.
       </action>


[21/28] logging-log4j2 git commit: LOG4J2-997 This closes #11

Posted by mi...@apache.org.
LOG4J2-997 This closes #11


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

Branch: refs/heads/LOG4J-1181
Commit: 5824cc2040ae8571e16149e91c3176f975465cdf
Parents: 5ae1f3f
Author: rpopma <rp...@apache.org>
Authored: Sun Jul 31 16:52:26 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Jul 31 16:52:26 2016 +0900

----------------------------------------------------------------------

----------------------------------------------------------------------



[17/28] logging-log4j2 git commit: LOG4J2-1489 (GC) Fixed %date conversion patterns with a timezone parameter are now garbage free.

Posted by mi...@apache.org.
LOG4J2-1489 (GC) Fixed %date conversion patterns with a timezone parameter are now garbage free.

This closes #36 (https://github.com/apache/logging-log4j2/pull/36).


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

Branch: refs/heads/LOG4J-1181
Commit: 0a85a77481e8ac289d36befb16828a99dd47cb96
Parents: 2bca903
Author: rpopma <rp...@apache.org>
Authored: Sun Jul 31 15:39:43 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Jul 31 15:39:43 2016 +0900

----------------------------------------------------------------------
 .../core/pattern/DatePatternConverter.java      |  2 +-
 .../core/util/datetime/FixedDateFormat.java     | 65 +++++++++++++++++---
 .../core/util/datetime/FixedDateFormatTest.java | 35 ++++++++---
 log4j-core/src/test/resources/gcFreeLogging.xml |  9 +--
 .../resources/gcFreeMixedSyncAsyncLogging.xml   | 10 +--
 src/changes/changes.xml                         |  3 +
 6 files changed, 94 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0a85a774/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
index 499f0d9..19edde5 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
@@ -224,7 +224,7 @@ public final class DatePatternConverter extends LogEventPatternConverter impleme
             LOGGER.warn("Could not instantiate FastDateFormat with pattern " + pattern, e);
 
             // default to the DEFAULT format
-            return createFixedFormatter(FixedDateFormat.create(FixedFormat.DEFAULT));
+            return createFixedFormatter(FixedDateFormat.create(FixedFormat.DEFAULT, tz));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0a85a774/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
index 25a5127..3b1f102 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.java
@@ -19,6 +19,7 @@ package org.apache.logging.log4j.core.util.datetime;
 
 import java.util.Calendar;
 import java.util.Objects;
+import java.util.TimeZone;
 
 /**
  * Custom time formatter that trades flexibility for performance. This formatter only supports the date patterns defined
@@ -156,11 +157,23 @@ public class FixedDateFormat {
          * @return the {@code FastDateFormat} object for formatting the date part of the pattern or {@code null}
          */
         public FastDateFormat getFastDateFormat() {
-            return getDatePattern() == null ? null : FastDateFormat.getInstance(getDatePattern());
+            return getFastDateFormat(null);
+        }
+
+        /**
+         * Returns the {@code FastDateFormat} object for formatting the date part of the pattern or {@code null} if the
+         * pattern does not have a date part.
+         *
+         * @param tz the time zone to use
+         * @return the {@code FastDateFormat} object for formatting the date part of the pattern or {@code null}
+         */
+        public FastDateFormat getFastDateFormat(TimeZone tz) {
+            return getDatePattern() == null ? null : FastDateFormat.getInstance(getDatePattern(), tz);
         }
     }
 
     private final FixedFormat fixedFormat;
+    private final TimeZone timeZone;
     private final int length;
     private final FastDateFormat fastDateFormat; // may be null
     private final char timeSeparatorChar;
@@ -186,35 +199,57 @@ public class FixedDateFormat {
      *
      * @param fixedFormat the fixed format
      */
-    FixedDateFormat(final FixedFormat fixedFormat) {
+    FixedDateFormat(final FixedFormat fixedFormat, final TimeZone tz) {
         this.fixedFormat = Objects.requireNonNull(fixedFormat);
+        this.timeZone = Objects.requireNonNull(tz);
         this.timeSeparatorChar = fixedFormat.timeSeparatorChar;
         this.timeSeparatorLength = fixedFormat.timeSeparatorLength;
         this.millisSeparatorChar = fixedFormat.millisSeparatorChar;
         this.millisSeparatorLength = fixedFormat.millisSeparatorLength;
         this.length = fixedFormat.getLength();
-        this.fastDateFormat = fixedFormat.getFastDateFormat();
+        this.fastDateFormat = fixedFormat.getFastDateFormat(tz);
     }
 
     public static FixedDateFormat createIfSupported(final String... options) {
         if (options == null || options.length == 0 || options[0] == null) {
-            return new FixedDateFormat(FixedFormat.DEFAULT);
+            return new FixedDateFormat(FixedFormat.DEFAULT, TimeZone.getDefault());
         }
+        final TimeZone tz;
         if (options.length > 1) {
-            return null; // time zone not supported
+            if (options[1] != null){
+                tz = TimeZone.getTimeZone(options[1]);
+            } else {
+                tz = TimeZone.getDefault();
+            }
+        } else if (options.length > 2) {
+            return null;
+        } else {
+            tz = TimeZone.getDefault();
         }
+
         final FixedFormat type = FixedFormat.lookup(options[0]);
-        return type == null ? null : new FixedDateFormat(type);
+        return type == null ? null : new FixedDateFormat(type, tz);
     }
 
     /**
-     * Returns a new {@code FixedDateFormat} object for the specified {@code FixedFormat} and a {@code null} TimeZone.
+     * Returns a new {@code FixedDateFormat} object for the specified {@code FixedFormat} and a {@code TimeZone.getDefault()} TimeZone.
      *
      * @param format the format to use
      * @return a new {@code FixedDateFormat} object
      */
     public static FixedDateFormat create(final FixedFormat format) {
-        return new FixedDateFormat(format);
+        return new FixedDateFormat(format, TimeZone.getDefault());
+    }
+
+    /**
+     * Returns a new {@code FixedDateFormat} object for the specified {@code FixedFormat} and TimeZone.
+     *
+     * @param format the format to use
+     * @param tz the time zone to use
+     * @return a new {@code FixedDateFormat} object
+     */
+    public static FixedDateFormat create(final FixedFormat format, final TimeZone tz) {
+        return new FixedDateFormat(format, tz != null ? tz : TimeZone.getDefault());
     }
 
     /**
@@ -226,6 +261,16 @@ public class FixedDateFormat {
         return fixedFormat.getPattern();
     }
 
+    /**
+     * Returns the time zone.
+     *
+     * @return the time zone
+     */
+
+    public TimeZone getTimeZone() {
+        return timeZone;
+    }
+
     // Profiling showed this method is important to log4j performance. Modify with care!
     // 30 bytes (allows immediate JVM inlining: <= -XX:MaxInlineSize=35 bytes)
     private long millisSinceMidnight(final long now) {
@@ -243,8 +288,8 @@ public class FixedDateFormat {
         midnightTomorrow = calcMidnightMillis(now, 1);
     }
 
-    static long calcMidnightMillis(final long time, final int addDays) {
-        final Calendar cal = Calendar.getInstance();
+    private long calcMidnightMillis(final long time, final int addDays) {
+        final Calendar cal = Calendar.getInstance(timeZone);
         cal.setTimeInMillis(time);
         cal.set(Calendar.HOUR_OF_DAY, 0);
         cal.set(Calendar.MINUTE, 0);

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0a85a774/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormatTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormatTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormatTest.java
index 0946d73..571e901 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormatTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/datetime/FixedDateFormatTest.java
@@ -20,6 +20,7 @@ package org.apache.logging.log4j.core.util.datetime;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Locale;
+import java.util.TimeZone;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.logging.log4j.core.util.datetime.FixedDateFormat.FixedFormat;
@@ -114,22 +115,36 @@ public class FixedDateFormatTest {
     public void testCreateIfSupported_defaultIfOptionsArrayWithSingleNullElement() {
         final FixedDateFormat fmt = FixedDateFormat.createIfSupported(new String[1]);
         assertEquals(FixedFormat.DEFAULT.getPattern(), fmt.getFormat());
+        assertEquals(TimeZone.getDefault(), fmt.getTimeZone());
     }
 
     @Test
-    public void testCreateIfSupported_nullIfOptionsArrayHasTwoElements() {
-        final String[] options = {FixedDateFormat.FixedFormat.ABSOLUTE.getPattern(), "+08:00"};
-        assertNull("timezone", FixedDateFormat.createIfSupported(options));
+    public void testCreateIfSupported_defaultTimeZoneIfOptionsArrayWithSecondNullElement() {
+        final FixedDateFormat fmt = FixedDateFormat.createIfSupported(new String[] {FixedFormat.DEFAULT.getPattern(), null, ""});
+        assertEquals(FixedFormat.DEFAULT.getPattern(), fmt.getFormat());
+        assertEquals(TimeZone.getDefault(), fmt.getTimeZone());
+    }
+
+    @Test
+    public void testCreateIfSupported_customTimeZoneIfOptionsArrayWithTimeZoneElement() {
+        final FixedDateFormat fmt = FixedDateFormat.createIfSupported(new String[] {FixedFormat.DEFAULT.getPattern(), "+08:00", ""});
+        assertEquals(FixedFormat.DEFAULT.getPattern(), fmt.getFormat());
+        assertEquals(TimeZone.getTimeZone("+08:00"), fmt.getTimeZone());
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void testConstructorDisallowsNullFormat() {
+        new FixedDateFormat(null, TimeZone.getDefault());
     }
 
     @Test(expected = NullPointerException.class)
-    public void testConstructorDisallowsNull() {
-        new FixedDateFormat(null);
+    public void testConstructorDisallowsNullTimeZone() {
+        new FixedDateFormat(FixedFormat.ABSOLUTE, null);
     }
 
     @Test
     public void testGetFormatReturnsConstructorFixedFormatPattern() {
-        final FixedDateFormat format = new FixedDateFormat(FixedDateFormat.FixedFormat.ABSOLUTE);
+        final FixedDateFormat format = new FixedDateFormat(FixedDateFormat.FixedFormat.ABSOLUTE, TimeZone.getDefault());
         assertSame(FixedDateFormat.FixedFormat.ABSOLUTE.getPattern(), format.getFormat());
     }
 
@@ -140,7 +155,7 @@ public class FixedDateFormatTest {
         final long end = now + TimeUnit.HOURS.toMillis(25);
         for (final FixedFormat format : FixedFormat.values()) {
             final SimpleDateFormat simpleDF = new SimpleDateFormat(format.getPattern(), Locale.getDefault());
-            final FixedDateFormat customTF = new FixedDateFormat(format);
+            final FixedDateFormat customTF = new FixedDateFormat(format, TimeZone.getDefault());
             for (long time = start; time < end; time += 12345) {
                 final String actual = customTF.format(time);
                 final String expected = simpleDF.format(new Date(time));
@@ -156,7 +171,7 @@ public class FixedDateFormatTest {
         final long end = now + TimeUnit.HOURS.toMillis(25);
         for (final FixedFormat format : FixedFormat.values()) {
             final SimpleDateFormat simpleDF = new SimpleDateFormat(format.getPattern(), Locale.getDefault());
-            final FixedDateFormat customTF = new FixedDateFormat(format);
+            final FixedDateFormat customTF = new FixedDateFormat(format, TimeZone.getDefault());
             for (long time = end; time > start; time -= 12345) {
                 final String actual = customTF.format(time);
                 final String expected = simpleDF.format(new Date(time));
@@ -173,7 +188,7 @@ public class FixedDateFormatTest {
         final char[] buffer = new char[128];
         for (final FixedFormat format : FixedFormat.values()) {
             final SimpleDateFormat simpleDF = new SimpleDateFormat(format.getPattern(), Locale.getDefault());
-            final FixedDateFormat customTF = new FixedDateFormat(format);
+            final FixedDateFormat customTF = new FixedDateFormat(format, TimeZone.getDefault());
             for (long time = start; time < end; time += 12345) {
                 final int length = customTF.format(time, buffer, 23);
                 final String actual = new String(buffer, 23, length);
@@ -191,7 +206,7 @@ public class FixedDateFormatTest {
         final char[] buffer = new char[128];
         for (final FixedFormat format : FixedFormat.values()) {
             final SimpleDateFormat simpleDF = new SimpleDateFormat(format.getPattern(), Locale.getDefault());
-            final FixedDateFormat customTF = new FixedDateFormat(format);
+            final FixedDateFormat customTF = new FixedDateFormat(format, TimeZone.getDefault());
             for (long time = end; time > start; time -= 12345) {
                 final int length = customTF.format(time, buffer, 23);
                 final String actual = new String(buffer, 23, length);

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0a85a774/log4j-core/src/test/resources/gcFreeLogging.xml
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/resources/gcFreeLogging.xml b/log4j-core/src/test/resources/gcFreeLogging.xml
index 8893466..97fc345 100644
--- a/log4j-core/src/test/resources/gcFreeLogging.xml
+++ b/log4j-core/src/test/resources/gcFreeLogging.xml
@@ -6,13 +6,13 @@
     </Console>
     <File name="File" fileName="target/gcfreefile.log" bufferedIO="false">
       <PatternLayout>
-        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
+        <Pattern>%d{DEFAULT}{UTC} %p %c{1.} [%t] %m%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
       </PatternLayout>
     </File>
     <RollingFile name="RollingFile" fileName="target/gcfreeRollingFile.log"
         filePattern="target/gcfree-%d{MM-dd-yy-HH-mm-ss}.log.gz">
       <PatternLayout>
-        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
+        <Pattern>%d{DEFAULT}{UTC} %p %c{1.} [%t] %m%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
       </PatternLayout>
       <Policies>
         <SizeBasedTriggeringPolicy size="50M" />
@@ -20,7 +20,7 @@
     </RollingFile>
     <RandomAccessFile name="RandomAccessFile" fileName="target/gcfreeRAF.log" immediateFlush="false" append="false">
       <PatternLayout>
-        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m %ex%n}</Pattern>
+        <Pattern>%d{DEFAULT}{UTC} %p %c{1.} [%t] %X{aKey} %m %ex%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m %ex%n}</Pattern>
       </PatternLayout>
     </RandomAccessFile>
     <RollingRandomAccessFile name="RollingRandomAccessFile"
@@ -28,7 +28,7 @@
         filePattern="target/afterRollover-%i.log" append="false"
         immediateFlush="false">
       <PatternLayout>
-        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m %location %ex%n}</Pattern>
+        <Pattern>%d{DEFAULT}{UTC} %p %c{1.} [%t] %X{aKey} %m %location %ex%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m %location %ex%n}</Pattern>
       </PatternLayout>
       <Policies>
         <SizeBasedTriggeringPolicy size="50 M"/>
@@ -38,6 +38,7 @@
         fileName="target/gcfreemmap.log"
         immediateFlush="false" append="false">
       <PatternLayout>
+        <Pattern>%d{DEFAULT}{UTC} %p %c{1.} [%t] %X{aKey} %m%ex%n</Pattern>
         <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m%ex%n}</Pattern>
       </PatternLayout>
     </MemoryMappedFile>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0a85a774/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml b/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml
index 50bff57..6944e36 100644
--- a/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml
+++ b/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml
@@ -6,13 +6,13 @@
     </Console>
     <File name="File" fileName="target/gcfreefileMixed.log" bufferedIO="false">
       <PatternLayout>
-        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
+        <Pattern>%d{DEFAULT}{UTC} %p %c{1.} [%t] %m%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
       </PatternLayout>
     </File>
     <RollingFile name="RollingFile" fileName="target/gcfreeRollingFileMixed.log"
         filePattern="target/gcfree-%d{MM-dd-yy-HH-mm-ss}.log.gz">
       <PatternLayout>
-        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
+        <Pattern>%d{DEFAULT}{UTC} %p %c{1.} [%t] %m%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
       </PatternLayout>
       <Policies>
         <SizeBasedTriggeringPolicy size="50M" />
@@ -20,7 +20,7 @@
     </RollingFile>
     <RandomAccessFile name="RandomAccessFile" fileName="target/gcfreeRAFMixed.log" immediateFlush="false" append="false">
       <PatternLayout>
-        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m %ex%n}</Pattern>
+        <Pattern>%d{DEFAULT}{UTC} %p %c{1.} [%t] %X{aKey} %m %ex%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m %ex%n}</Pattern>
       </PatternLayout>
     </RandomAccessFile>
     <RollingRandomAccessFile name="RollingRandomAccessFile"
@@ -28,7 +28,7 @@
         filePattern="target/afterRollover-%i.log" append="false"
         immediateFlush="false">
       <PatternLayout>
-        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m %location %ex%n}</Pattern>
+        <Pattern>%d{DEFAULT}{UTC} %p %c{1.} [%t] %X{aKey} %m %location %ex%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m %location %ex%n}</Pattern>
       </PatternLayout>
       <Policies>
         <SizeBasedTriggeringPolicy size="50 M"/>
@@ -38,7 +38,7 @@
         fileName="target/gcfreemmapMixed.log"
         immediateFlush="false" append="false">
       <PatternLayout>
-        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m%ex%n}</Pattern>
+        <Pattern>%d{DEFAULT}{UTC} %p %c{1.} [%t] %X{aKey} %m%ex%n %highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m%ex%n}</Pattern>
       </PatternLayout>
     </MemoryMappedFile>
     <RandomAccessFile name="RandomAccessFileGelf" fileName="target/gcfreeMixed.json" immediateFlush="false" append="false">

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0a85a774/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index cbb8466..7e44b1b 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -24,6 +24,9 @@
   </properties>
   <body>
     <release version="2.7" date="2016-MM-DD" description="GA Release 2.7">
+      <action issue="LOG4J2-1489" dev="rpopma" type="fix" due-to="Richard Zschech">
+        (GC) Fixed %date conversion patterns with a timezone parameter are now garbage free.
+      </action>
       <action issue="LOG4J2-1279" dev="rpopma" type="fix" due-to="Tony Baines">
         Prevent NullPointerException in FastDateParser$TimeZoneStrategy.
       </action>


[11/28] logging-log4j2 git commit: Allow OSGi Eclipse and Felix-based tests to run a little further than class not found exceptions; the tests are @Ignore'd still, since they fail for other reasons.

Posted by mi...@apache.org.
Allow OSGi Eclipse and Felix-based tests to run a little further than
class not found exceptions; the tests are @Ignore'd still, since they
fail for other reasons.

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

Branch: refs/heads/LOG4J-1181
Commit: 85290864c048100e75d35b21777fb3665293d18a
Parents: 5f9684f
Author: Gary Gregory <gg...@apache.org>
Authored: Thu Jul 28 22:12:16 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu Jul 28 22:12:16 2016 -0700

----------------------------------------------------------------------
 log4j-core/pom.xml | 10 ++++++++++
 pom.xml            |  6 ++++++
 2 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/85290864/log4j-core/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml
index d911390..d06713d 100644
--- a/log4j-core/pom.xml
+++ b/log4j-core/pom.xml
@@ -245,6 +245,16 @@
       <artifactId>org.apache.felix.framework</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+      <scope>test</scope>
+    </dependency>
     <!--  GELF -->
     <dependency>
       <groupId>net.javacrumbs.json-unit</groupId>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/85290864/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c69ca60..a91c73f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -622,6 +622,12 @@
         <scope>test</scope>
       </dependency>
       <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-utils</artifactId>
+        <version>3.0.24</version>
+        <scope>test</scope>
+      </dependency>      
+      <dependency>
         <groupId>org.easymock</groupId>
         <artifactId>easymock</artifactId>
         <version>3.4</version>


[02/28] logging-log4j2 git commit: [LOG4J2-1467][OSGi] Missing import package. [LOG4J2-351][OSGi] wrong Fragment-Host in manifest files.

Posted by mi...@apache.org.
[LOG4J2-1467][OSGi] Missing import package.
[LOG4J2-351][OSGi] wrong Fragment-Host in manifest files.


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

Branch: refs/heads/LOG4J-1181
Commit: 8b569ca42da7a39187bc3a7c070408f8b26a36f3
Parents: 0116c0c
Author: Gary Gregory <gg...@apache.org>
Authored: Tue Jul 26 16:49:12 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Tue Jul 26 16:49:12 2016 -0700

----------------------------------------------------------------------
 log4j-1.2-api/pom.xml   | 1 +
 log4j-flume-ng/pom.xml  | 1 +
 log4j-jmx-gui/pom.xml   | 1 +
 log4j-jul/pom.xml       | 1 +
 log4j-nosql/pom.xml     | 1 +
 log4j-web/pom.xml       | 1 +
 src/changes/changes.xml | 6 ++++++
 7 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8b569ca4/log4j-1.2-api/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/pom.xml b/log4j-1.2-api/pom.xml
index dd8b0df..779f050 100644
--- a/log4j-1.2-api/pom.xml
+++ b/log4j-1.2-api/pom.xml
@@ -108,6 +108,7 @@
         <artifactId>maven-bundle-plugin</artifactId>
         <configuration>
           <instructions>
+            <Fragment-Host>org.apache.logging.log4j.core</Fragment-Host>
             <Export-Package>org.apache.log4j.*</Export-Package>
           </instructions>
         </configuration>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8b569ca4/log4j-flume-ng/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-flume-ng/pom.xml b/log4j-flume-ng/pom.xml
index ee8ae80..1f95db0 100644
--- a/log4j-flume-ng/pom.xml
+++ b/log4j-flume-ng/pom.xml
@@ -148,6 +148,7 @@
         <artifactId>maven-bundle-plugin</artifactId>
         <configuration>
           <instructions>
+            <Fragment-Host>org.apache.logging.log4j.core</Fragment-Host>
             <Bundle-SymbolicName>org.apache.logging.log4j.flume</Bundle-SymbolicName>
             <Export-Package>org.apache.logging.log4j.flume.appender</Export-Package>
           </instructions>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8b569ca4/log4j-jmx-gui/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-jmx-gui/pom.xml b/log4j-jmx-gui/pom.xml
index beef3a1..240eaf1 100644
--- a/log4j-jmx-gui/pom.xml
+++ b/log4j-jmx-gui/pom.xml
@@ -78,6 +78,7 @@
         <artifactId>maven-bundle-plugin</artifactId>
         <configuration>
           <instructions>
+            <Fragment-Host>org.apache.logging.log4j.core</Fragment-Host>
             <Export-Package>org.apache.logging.log4j.jmx.gui</Export-Package>
           </instructions>
         </configuration>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8b569ca4/log4j-jul/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-jul/pom.xml b/log4j-jul/pom.xml
index 9e63f57..2a1c448 100644
--- a/log4j-jul/pom.xml
+++ b/log4j-jul/pom.xml
@@ -83,6 +83,7 @@
         <artifactId>maven-bundle-plugin</artifactId>
         <configuration>
           <instructions>
+            <Fragment-Host>org.apache.logging.log4j.core</Fragment-Host>
             <Export-Package>org.apache.logging.log4j.jul</Export-Package>
           </instructions>
         </configuration>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8b569ca4/log4j-nosql/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-nosql/pom.xml b/log4j-nosql/pom.xml
index 20ede1e..b93c191 100644
--- a/log4j-nosql/pom.xml
+++ b/log4j-nosql/pom.xml
@@ -71,6 +71,7 @@
         <artifactId>maven-bundle-plugin</artifactId>
         <configuration>
           <instructions>
+            <Fragment-Host>org.apache.logging.log4j.core</Fragment-Host>
             <Export-Package>*</Export-Package>
           </instructions>
         </configuration>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8b569ca4/log4j-web/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-web/pom.xml b/log4j-web/pom.xml
index 148acc0..3a134b0 100644
--- a/log4j-web/pom.xml
+++ b/log4j-web/pom.xml
@@ -83,6 +83,7 @@
         <configuration>
           <instructions>
             <!-- we compile against 3.0, but require 2.5 minimum -->
+            <Fragment-Host>org.apache.logging.log4j.core</Fragment-Host>
             <Import-Package>javax.servlet;version="[2.5,4)",*</Import-Package>
             <Export-Package>org.apache.logging.log4j.web</Export-Package>
           </instructions>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8b569ca4/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index a09a572..8ec3453 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -24,6 +24,12 @@
   </properties>
   <body>
     <release version="2.7.0" date="2016-MM-DD" description="GA Release 2.7.0">
+      <action issue="LOG4J2-1467" dev="rpopma, ggregory" type="fix" due-to="Ralf, Gary Gregory">
+        [OSGi] Missing import package.
+      </action>
+      <action issue="LOG4J2-351" dev="rpopma, ggregory" type="fix" due-to="Roland Weiglhofer">
+        [OSGi] wrong Fragment-Host in manifest files.
+      </action>
       <action issue="LOG4J2-1471" dev="ggregory" type="add" due-to="Gary Gregory">
         [PatternLayout] Add an ANSI option to %xThrowable.
       </action>


[28/28] logging-log4j2 git commit: Merge branch 'master' into LOG4J-1181

Posted by mi...@apache.org.
Merge branch 'master' into LOG4J-1181


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

Branch: refs/heads/LOG4J-1181
Commit: 2e5b2591913af0d43cb9f781f35466ac2da9f202
Parents: de52134 2490cbe
Author: Mikael St�ldal <mi...@magine.com>
Authored: Wed Aug 3 13:33:32 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Wed Aug 3 13:33:32 2016 +0200

----------------------------------------------------------------------
 log4j-1.2-api/pom.xml                           |   1 +
 .../logging/log4j/message/ObjectMessage.java    |  10 ++
 .../log4j/message/ReusableObjectMessage.java    |  10 ++
 .../org/apache/logging/log4j/util/Unbox.java    |   1 +
 .../apache/logging/log4j/TraceLoggingTest.java  |   1 -
 .../logging/log4j/junit/BundleTestInfo.java     | 137 +++++++++---------
 .../apache/logging/log4j/junit/OsgiRule.java    | 141 ++++++++++---------
 log4j-core/.gitignore                           |  11 +-
 log4j-core/pom.xml                              |  10 ++
 .../rolling/action/FileRenameAction.java        |   1 -
 .../core/pattern/DatePatternConverter.java      |   2 +-
 .../log4j/core/pattern/HighlightConverter.java  |  38 +++--
 .../log4j/core/pattern/JAnsiTextRenderer.java   |   2 -
 .../log4j/core/pattern/NameAbbreviator.java     |   2 +
 .../log4j/core/pattern/StyleConverter.java      |  24 ++--
 .../apache/logging/log4j/core/util/Loader.java  |   1 -
 .../core/util/datetime/FastDateParser.java      |  54 +++----
 .../core/util/datetime/FixedDateFormat.java     |  77 ++++++++--
 .../core/layout/CsvParameterLayoutTest.java     |   1 -
 .../osgi/equinox/EquinoxLoadCoreBundleTest.java |   6 +-
 .../osgi/felix/FelixLoadCoreBundleTest.java     |   4 +
 .../core/pattern/DatePatternConverterTest.java  |  22 +++
 .../core/pattern/HighlightConverterTest.java    |  78 ++++++++++
 .../core/util/datetime/FixedDateFormatTest.java |  35 +++--
 log4j-core/src/test/resources/gcFreeLogging.xml |  11 +-
 .../resources/gcFreeMixedSyncAsyncLogging.xml   |  10 +-
 log4j-core/src/test/resources/log4j-style.xml   |   4 +-
 log4j-flume-ng/pom.xml                          |   1 +
 log4j-jmx-gui/pom.xml                           |   1 +
 log4j-jul/pom.xml                               |   1 +
 log4j-nosql/pom.xml                             |   1 +
 .../org/apache/logging/slf4j/Log4j1222Test.java |   1 -
 log4j-web/pom.xml                               |   1 +
 pom.xml                                         |   6 +
 src/changes/announcement.vm                     |  15 +-
 src/changes/changes.xml                         |  26 +++-
 src/site/xdoc/manual/garbagefree.xml            |  10 +-
 src/site/xdoc/manual/lookups.xml                |  18 +--
 38 files changed, 530 insertions(+), 245 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2e5b2591/pom.xml
----------------------------------------------------------------------


[12/28] logging-log4j2 git commit: LOG4J2-1341 (GC) HighlightConverter and StyleConverter are now GC-free.

Posted by mi...@apache.org.
LOG4J2-1341 (GC) HighlightConverter and StyleConverter are now GC-free.

This closes GitHub pull request #34 (https://github.com/apache/logging-log4j2/pull/34).


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

Branch: refs/heads/LOG4J-1181
Commit: c4af088d7d0a181f4e9b84f401bd56f2e1342797
Parents: 8529086
Author: rpopma <rp...@apache.org>
Authored: Sun Jul 31 14:43:14 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Jul 31 14:43:14 2016 +0900

----------------------------------------------------------------------
 .../log4j/core/pattern/HighlightConverter.java  | 37 ++++++----
 .../log4j/core/pattern/StyleConverter.java      | 24 ++++--
 .../core/pattern/HighlightConverterTest.java    | 78 ++++++++++++++++++++
 log4j-core/src/test/resources/gcFreeLogging.xml | 10 +--
 .../resources/gcFreeMixedSyncAsyncLogging.xml   | 10 +--
 log4j-core/src/test/resources/log4j-style.xml   |  4 +-
 src/changes/changes.xml                         |  5 +-
 src/site/xdoc/manual/garbagefree.xml            | 10 ++-
 8 files changed, 143 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c4af088d/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
index 0e2f63d..c0ab673 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
@@ -34,14 +34,14 @@ import org.apache.logging.log4j.util.Strings;
  * <p>
  * For example:
  * </p>
- * 
+ *
  * <pre>
  * %highlight{%d{ ISO8601 } [%t] %-5level: %msg%n%throwable}
  * </pre>
  * <p>
  * You can define custom colors for each Level:
  * </p>
- * 
+ *
  * <pre>
  * %highlight{%d{ ISO8601 } [%t] %-5level: %msg%n%throwable}{FATAL=red, ERROR=red, WARN=yellow, INFO=green, DEBUG=cyan,
  * TRACE=black}
@@ -49,9 +49,9 @@ import org.apache.logging.log4j.util.Strings;
  * <p>
  * You can use a predefined style:
  * </p>
- * 
+ *
  * <pre>
- * %highlight{%d{ ISO8601 } [%t] %-5level: %msg%n%throwable}{STYLE=Log4j}
+ * %highlight{%d{ ISO8601 } [%t] %-5level: %msg%n%throwable}{STYLE=DEFAULT}
  * </pre>
  * <p>
  * The available predefined styles are:
@@ -108,7 +108,7 @@ public final class HighlightConverter extends LogEventPatternConverter implement
      * <p>
      * The format of the option string in {@code option[1]} is:
      * </p>
-     * 
+     *
      * <pre>
      * Level1=Value, Level2=Value, ...
      * </pre>
@@ -193,6 +193,8 @@ public final class HighlightConverter extends LogEventPatternConverter implement
 
     private final boolean noAnsi;
 
+    private final String defaultStyle;
+
     /**
      * Construct the converter.
      *
@@ -205,6 +207,7 @@ public final class HighlightConverter extends LogEventPatternConverter implement
         super("style", "style");
         this.patternFormatters = patternFormatters;
         this.levelStyles = levelStyles;
+        this.defaultStyle = AnsiEscape.getDefaultStyle();
         this.noAnsi = noAnsi;
     }
 
@@ -213,17 +216,25 @@ public final class HighlightConverter extends LogEventPatternConverter implement
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        final StringBuilder buf = new StringBuilder();
-        for (final PatternFormatter formatter : patternFormatters) {
-            formatter.format(event, buf);
+        final int start = toAppendTo.length();
+        int end = 0;
+        if (!noAnsi) { // use ANSI: set prefix
+            toAppendTo.append(levelStyles.get(event.getLevel()));
+            end = toAppendTo.length();
+        }
+
+        //noinspection ForLoopReplaceableByForEach
+        for (int i = 0, size = patternFormatters.size(); i <  size; i++) {
+            patternFormatters.get(i).format(event, toAppendTo);
         }
 
-        if (buf.length() > 0) {
-            if (noAnsi) {
-                toAppendTo.append(buf.toString());
+        // if we use ANSI we need to add the postfix or erase the unnecessary prefix
+        final boolean empty = toAppendTo.length() == end;
+        if (!noAnsi) {
+            if (empty) {
+                toAppendTo.setLength(start); // erase prefix
             } else {
-                toAppendTo.append(levelStyles.get(event.getLevel())).append(buf.toString()).
-                    append(AnsiEscape.getDefaultStyle());
+                toAppendTo.append(defaultStyle); // add postfix
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c4af088d/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java
index 202d771..0d8c730 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java
@@ -94,17 +94,25 @@ public final class StyleConverter extends LogEventPatternConverter implements An
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        final StringBuilder buf = new StringBuilder();
-        for (final PatternFormatter formatter : patternFormatters) {
-            formatter.format(event, buf);
+        int start = 0;
+        int end = 0;
+        if (!noAnsi) { // use ANSI: set prefix
+            start = toAppendTo.length();
+            toAppendTo.append(style);
+            end = toAppendTo.length();
+        }
+
+        //noinspection ForLoopReplaceableByForEach
+        for (int i = 0, size = patternFormatters.size(); i <  size; i++) {
+            patternFormatters.get(i).format(event, toAppendTo);
         }
 
-        if (buf.length() > 0) {
-            if (noAnsi) {
-                // faster to test and do this than setting style and defaultStyle to empty strings.
-                toAppendTo.append(buf.toString());
+        // if we use ANSI we need to add the postfix or erase the unnecessary prefix
+        if (!noAnsi) {
+            if (toAppendTo.length() == end) {
+                toAppendTo.setLength(start); // erase prefix
             } else {
-                toAppendTo.append(style).append(buf.toString()).append(defaultStyle);
+                toAppendTo.append(defaultStyle); // add postfix
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c4af088d/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/HighlightConverterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/HighlightConverterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/HighlightConverterTest.java
new file mode 100644
index 0000000..6051f85
--- /dev/null
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/HighlightConverterTest.java
@@ -0,0 +1,78 @@
+package org.apache.logging.log4j.core.pattern;/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.impl.Log4jLogEvent;
+import org.apache.logging.log4j.message.SimpleMessage;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Tests the HighlightConverter.
+ */
+public class HighlightConverterTest {
+
+    @Test
+    public void testAnsiEmpty() {
+        final String[] options = {"", PatternParser.NO_CONSOLE_NO_ANSI + "=false"};
+        final HighlightConverter converter = HighlightConverter.newInstance(null, options);
+
+        final LogEvent event = Log4jLogEvent.newBuilder().setLevel(Level.INFO).setLoggerName("a.b.c").setMessage(
+                new SimpleMessage("message in a bottle")).build();
+        final StringBuilder buffer = new StringBuilder();
+        converter.format(event, buffer);
+        assertEquals("", buffer.toString());
+    }
+
+    @Test
+    public void testAnsiNonEmpty() {
+        final String[] options = {"%-5level: %msg", PatternParser.NO_CONSOLE_NO_ANSI + "=false"};
+        final HighlightConverter converter = HighlightConverter.newInstance(null, options);
+
+        final LogEvent event = Log4jLogEvent.newBuilder().setLevel(Level.INFO).setLoggerName("a.b.c").setMessage(
+                new SimpleMessage("message in a bottle")).build();
+        final StringBuilder buffer = new StringBuilder();
+        converter.format(event, buffer);
+        assertEquals("\u001B[32mINFO : message in a bottle\u001B[m", buffer.toString());
+    }
+
+    @Test
+    public void testNoAnsiEmpty() {
+        final String[] options = {"", PatternParser.NO_CONSOLE_NO_ANSI + "=true"};
+        final HighlightConverter converter = HighlightConverter.newInstance(null, options);
+
+        final LogEvent event = Log4jLogEvent.newBuilder().setLevel(Level.INFO).setLoggerName("a.b.c").setMessage(
+                new SimpleMessage("message in a bottle")).build();
+        final StringBuilder buffer = new StringBuilder();
+        converter.format(event, buffer);
+        assertEquals("", buffer.toString());
+    }
+
+    @Test
+    public void testNoAnsiNonEmpty() {
+        final String[] options = {"%-5level: %msg", PatternParser.NO_CONSOLE_NO_ANSI + "=true"};
+        final HighlightConverter converter = HighlightConverter.newInstance(null, options);
+
+        final LogEvent event = Log4jLogEvent.newBuilder().setLevel(Level.INFO).setLoggerName("a.b.c").setMessage(
+                new SimpleMessage("message in a bottle")).build();
+        final StringBuilder buffer = new StringBuilder();
+        converter.format(event, buffer);
+        assertEquals("INFO : message in a bottle", buffer.toString());
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c4af088d/log4j-core/src/test/resources/gcFreeLogging.xml
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/resources/gcFreeLogging.xml b/log4j-core/src/test/resources/gcFreeLogging.xml
index f90d754..8893466 100644
--- a/log4j-core/src/test/resources/gcFreeLogging.xml
+++ b/log4j-core/src/test/resources/gcFreeLogging.xml
@@ -6,13 +6,13 @@
     </Console>
     <File name="File" fileName="target/gcfreefile.log" bufferedIO="false">
       <PatternLayout>
-        <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
+        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
       </PatternLayout>
     </File>
     <RollingFile name="RollingFile" fileName="target/gcfreeRollingFile.log"
         filePattern="target/gcfree-%d{MM-dd-yy-HH-mm-ss}.log.gz">
       <PatternLayout>
-        <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
+        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
       </PatternLayout>
       <Policies>
         <SizeBasedTriggeringPolicy size="50M" />
@@ -20,7 +20,7 @@
     </RollingFile>
     <RandomAccessFile name="RandomAccessFile" fileName="target/gcfreeRAF.log" immediateFlush="false" append="false">
       <PatternLayout>
-        <Pattern>%d %p %c{1.} [%t] %X{aKey} %m %ex%n</Pattern>
+        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m %ex%n}</Pattern>
       </PatternLayout>
     </RandomAccessFile>
     <RollingRandomAccessFile name="RollingRandomAccessFile"
@@ -28,7 +28,7 @@
         filePattern="target/afterRollover-%i.log" append="false"
         immediateFlush="false">
       <PatternLayout>
-        <Pattern>%d %p %c{1.} [%t] %X{aKey} %m %location %ex%n</Pattern>
+        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m %location %ex%n}</Pattern>
       </PatternLayout>
       <Policies>
         <SizeBasedTriggeringPolicy size="50 M"/>
@@ -38,7 +38,7 @@
         fileName="target/gcfreemmap.log"
         immediateFlush="false" append="false">
       <PatternLayout>
-        <Pattern>%d %p %c{1.} [%t] %X{aKey} %m%ex%n</Pattern>
+        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m%ex%n}</Pattern>
       </PatternLayout>
     </MemoryMappedFile>
     <RandomAccessFile name="RandomAccessFileGelf" fileName="target/gcfree.json" immediateFlush="false" append="false">

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c4af088d/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml b/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml
index e4c0000..50bff57 100644
--- a/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml
+++ b/log4j-core/src/test/resources/gcFreeMixedSyncAsyncLogging.xml
@@ -6,13 +6,13 @@
     </Console>
     <File name="File" fileName="target/gcfreefileMixed.log" bufferedIO="false">
       <PatternLayout>
-        <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
+        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
       </PatternLayout>
     </File>
     <RollingFile name="RollingFile" fileName="target/gcfreeRollingFileMixed.log"
         filePattern="target/gcfree-%d{MM-dd-yy-HH-mm-ss}.log.gz">
       <PatternLayout>
-        <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
+        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %m%n}</Pattern>
       </PatternLayout>
       <Policies>
         <SizeBasedTriggeringPolicy size="50M" />
@@ -20,7 +20,7 @@
     </RollingFile>
     <RandomAccessFile name="RandomAccessFile" fileName="target/gcfreeRAFMixed.log" immediateFlush="false" append="false">
       <PatternLayout>
-        <Pattern>%d %p %c{1.} [%t] %X{aKey} %m %ex%n</Pattern>
+        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m %ex%n}</Pattern>
       </PatternLayout>
     </RandomAccessFile>
     <RollingRandomAccessFile name="RollingRandomAccessFile"
@@ -28,7 +28,7 @@
         filePattern="target/afterRollover-%i.log" append="false"
         immediateFlush="false">
       <PatternLayout>
-        <Pattern>%d %p %c{1.} [%t] %X{aKey} %m %location %ex%n</Pattern>
+        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m %location %ex%n}</Pattern>
       </PatternLayout>
       <Policies>
         <SizeBasedTriggeringPolicy size="50 M"/>
@@ -38,7 +38,7 @@
         fileName="target/gcfreemmapMixed.log"
         immediateFlush="false" append="false">
       <PatternLayout>
-        <Pattern>%d %p %c{1.} [%t] %X{aKey} %m%ex%n</Pattern>
+        <Pattern>%highlight{%style{%d}{bright,cyan} %p %c{1.} [%t] %X{aKey} %m%ex%n}</Pattern>
       </PatternLayout>
     </MemoryMappedFile>
     <RandomAccessFile name="RandomAccessFileGelf" fileName="target/gcfreeMixed.json" immediateFlush="false" append="false">

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c4af088d/log4j-core/src/test/resources/log4j-style.xml
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/resources/log4j-style.xml b/log4j-core/src/test/resources/log4j-style.xml
index 9b18b37..6acf873 100644
--- a/log4j-core/src/test/resources/log4j-style.xml
+++ b/log4j-core/src/test/resources/log4j-style.xml
@@ -20,7 +20,7 @@
   <Appenders>
     <List name="List">
        <PatternLayout>
-         <Pattern>%d %highlight{%p} %style{%logger}{bright,cyan} %C{1.} %msg%n</Pattern>
+         <Pattern>%d %highlight{%p} %style{%logger}{bright,cyan}%style{}{bright,cyan} %C{1.} %msg%n</Pattern>
       </PatternLayout>
     </List>
   </Appenders>
@@ -31,4 +31,4 @@
     </Root>
   </Loggers>
 
-</Configuration>
\ No newline at end of file
+</Configuration>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c4af088d/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 8ec3453..25d4b07 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -23,7 +23,10 @@
     <title>Changes</title>
   </properties>
   <body>
-    <release version="2.7.0" date="2016-MM-DD" description="GA Release 2.7.0">
+    <release version="2.7" date="2016-MM-DD" description="GA Release 2.7.0">
+      <action issue="LOG4J2-1341" dev="rpopma" type="fix" due-to="Richard Zschech">
+        (GC) HighlightConverter and StyleConverter are now GC-free.
+      </action>
       <action issue="LOG4J2-1467" dev="rpopma, ggregory" type="fix" due-to="Ralf, Gary Gregory">
         [OSGi] Missing import package.
       </action>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c4af088d/src/site/xdoc/manual/garbagefree.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/manual/garbagefree.xml b/src/site/xdoc/manual/garbagefree.xml
index 58ca1d0..46499d5 100644
--- a/src/site/xdoc/manual/garbagefree.xml
+++ b/src/site/xdoc/manual/garbagefree.xml
@@ -234,6 +234,14 @@
               </td>
             </tr>
             <tr>
+              <td>%highlight{pattern}{style}</td>
+              <td>Adds ANSI colors (unless nested pattern is not garbage free)</td>
+            </tr>
+            <tr>
+              <td>style{pattern}{ANSI style}</td>
+              <td>Style the message (unless nested pattern is not garbage free)</td>
+            </tr>
+            <tr>
               <td>%m, %msg, %message</td>
               <td>Log message (unless message text contains '${')</td>
             </tr>
@@ -501,4 +509,4 @@ public void garbageFree() {
       </subsection>
     </section>
   </body>
-</document>
\ No newline at end of file
+</document>


[20/28] logging-log4j2 git commit: LOG4J2-1199 Document that JVM Input Arguments Lookup (JMX) is not available on Google App Engine.

Posted by mi...@apache.org.
LOG4J2-1199 Document that JVM Input Arguments Lookup (JMX) is not available on Google App Engine.


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

Branch: refs/heads/LOG4J-1181
Commit: 5ae1f3feeb96c044294004daf2bead9c8f6b2588
Parents: 8803998
Author: rpopma <rp...@apache.org>
Authored: Sun Jul 31 16:36:05 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Jul 31 16:36:05 2016 +0900

----------------------------------------------------------------------
 src/changes/changes.xml          |  3 +++
 src/site/xdoc/manual/lookups.xml | 18 +++++++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5ae1f3fe/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index da03a3e..b451094 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -24,6 +24,9 @@
   </properties>
   <body>
     <release version="2.7" date="2016-MM-DD" description="GA Release 2.7">
+      <action issue="LOG4J2-1199" dev="rpopma" type="fix">
+        Document that JVM Input Arguments Lookup (JMX) is not available on Google App Engine.
+      </action>
       <action issue="LOG4J2-1438" dev="rpopma" type="fix">
         (GC) Add method getParameter() to ObjectMessage (and ReusableObjectMessage).
       </action>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5ae1f3fe/src/site/xdoc/manual/lookups.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/manual/lookups.xml b/src/site/xdoc/manual/lookups.xml
index 18c508f..f244605 100644
--- a/src/site/xdoc/manual/lookups.xml
+++ b/src/site/xdoc/manual/lookups.xml
@@ -169,17 +169,17 @@
             Use the prefix <code>jvmrunargs</code> to access JVM arguments.
           </p>
           <p>
-            See the Javadocs for 
+            See the Javadocs for
             <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/management/RuntimeMXBean.html#getInputArguments--">
             java.lang.management.RuntimeMXBean.getInputArguments()
             </a>.
           </p>
-          <p><strong>Java's JMX module is not available on Android.</strong></p>
+          <p><strong>Java's JMX module is not available on Android or on Google App Engine.</strong></p>
         </subsection>
         <a name="Log4jConfigLookup"/>
         <subsection name="Log4j Configuration Location Lookup">
           <p>
-            Log4j configuration properties. The expressions 
+            Log4j configuration properties. The expressions
             <code>${log4j:configLocation}</code> and <code>${log4j:configParentLocation}</code>
             respectively provide the absolute path to the log4j configuration file
             and its parent folder.
@@ -284,7 +284,7 @@ public static void main(String args[]) {
     <Pattern>%d %m%n</Pattern>
   </PatternLayout>
 </File>]]></pre>
-        </subsection>  
+        </subsection>
         <a name="MapLookup"/>
         <subsection name="Map Lookup">
           <p>
@@ -363,7 +363,7 @@ Configuration:
     Root:
       level: trace
       AppenderRef:
-        - ref: ROUTING_APPENDER]]></pre>          
+        - ref: ROUTING_APPENDER]]></pre>
           <pre class="prettyprint linenums"><![CDATA[
 public static final Marker SQL = MarkerFactory.getMarker("SQL");
 public static final Marker PAYLOAD = MarkerFactory.getMarker("PAYLOAD");
@@ -380,11 +380,11 @@ logger.info(PERFORMANCE, "Message in Performance.log");]]></pre>
             <code>sql.log</code>, the log event with the <code>PAYLOAD</code> marker to <code>payload.log</code>, and so on.
           </p>
           <p>
-            You can use the notation <code>"${marker:name}"</code> and <code>"$${marker:name}"</code> to check for the 
-            existence of a marker where <code>name</code> is the marker name. If the marker exists, the expression returns 
-            the name, otherwise <code>null</code>. 
+            You can use the notation <code>"${marker:name}"</code> and <code>"$${marker:name}"</code> to check for the
+            existence of a marker where <code>name</code> is the marker name. If the marker exists, the expression returns
+            the name, otherwise <code>null</code>.
           </p>
-        </subsection>        
+        </subsection>
         <a name="StructuredDataLookup"/>
         <subsection name="Structured Data Lookup">
           <p>


[08/28] logging-log4j2 git commit: Ignore felix-cache folder.

Posted by mi...@apache.org.
Ignore felix-cache folder.

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

Branch: refs/heads/LOG4J-1181
Commit: 83dda19ee681484dbe6be991ab4254516f62fd64
Parents: 2acc3c2
Author: Gary Gregory <gg...@apache.org>
Authored: Thu Jul 28 17:19:07 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu Jul 28 17:19:07 2016 -0700

----------------------------------------------------------------------
 log4j-core/.gitignore | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/83dda19e/log4j-core/.gitignore
----------------------------------------------------------------------
diff --git a/log4j-core/.gitignore b/log4j-core/.gitignore
index df2b0e2..040a346 100644
--- a/log4j-core/.gitignore
+++ b/log4j-core/.gitignore
@@ -1,5 +1,6 @@
-/.settings/
-/target/
-/.classpath
-/.project
-/bin/
+/.settings/
+/target/
+/.classpath
+/.project
+/bin/
+/felix-cache/


[23/28] logging-log4j2 git commit: LOG4J2-1438 Added @since 2.7 javadoc

Posted by mi...@apache.org.
LOG4J2-1438 Added @since 2.7 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/4bcd749c
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/4bcd749c
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/4bcd749c

Branch: refs/heads/LOG4J-1181
Commit: 4bcd749c3dba9689ced8e1810630d4cf3075a3b8
Parents: 7191e0f
Author: rpopma <rp...@apache.org>
Authored: Mon Aug 1 23:52:02 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Mon Aug 1 23:52:02 2016 +0900

----------------------------------------------------------------------
 .../main/java/org/apache/logging/log4j/message/ObjectMessage.java   | 1 +
 .../org/apache/logging/log4j/message/ReusableObjectMessage.java     | 1 +
 2 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/4bcd749c/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
index 40bb6d6..2ca08b0 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
@@ -97,6 +97,7 @@ public class ObjectMessage implements Message, StringBuilderFormattable {
      * Returns the object parameter.
      *
      * @return The object.
+     * @since 2.7
      */
     public Object getParameter() {
         return obj;

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/4bcd749c/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java
index ec14fbb..69ad3b6 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java
@@ -85,6 +85,7 @@ public class ReusableObjectMessage implements ReusableMessage {
      * Returns the object parameter.
      *
      * @return The object.
+     * @since 2.7
      */
     public Object getParameter() {
         return obj;


[06/28] logging-log4j2 git commit: Javadoc.

Posted by mi...@apache.org.
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/0a316f31
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/0a316f31
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/0a316f31

Branch: refs/heads/LOG4J-1181
Commit: 0a316f31b3e01804dfdb486bd7bda6b63b2894f4
Parents: a71d29f
Author: Gary Gregory <gg...@apache.org>
Authored: Thu Jul 28 16:59:45 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu Jul 28 16:59:45 2016 -0700

----------------------------------------------------------------------
 .../log4j/core/osgi/equinox/EquinoxLoadCoreBundleTest.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0a316f31/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/equinox/EquinoxLoadCoreBundleTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/equinox/EquinoxLoadCoreBundleTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/equinox/EquinoxLoadCoreBundleTest.java
index 90f6444..8995aa5 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/equinox/EquinoxLoadCoreBundleTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/equinox/EquinoxLoadCoreBundleTest.java
@@ -26,7 +26,11 @@ import org.junit.Ignore;
  * Requires that "mvn package" has been previously run, otherwise test fails its JUnit {@link Assume}.
  * </p>
  * <p>
- * For example, on Windows: "mvn clean package -DskipTests & mvn test"
+ * For example, on Windows: {@code mvn clean package -DskipTests & mvn test}
+ * </p>
+ * <p>
+ * To only test this class: {@code mvn -pl log4j-core -DskipTests clean package & mvn -pl log4j-core 
+ * -Dtest=EquinoxLoadCoreBundleTest test}
  * </p>
  */
 @Ignore


[27/28] logging-log4j2 git commit: Remove blank line.

Posted by mi...@apache.org.
Remove blank line.

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

Branch: refs/heads/LOG4J-1181
Commit: 2490cbe59c47025cdfee445bc22af42c69544931
Parents: 7ca4dfe
Author: Gary Gregory <gg...@apache.org>
Authored: Tue Aug 2 21:20:13 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Tue Aug 2 21:20:13 2016 -0700

----------------------------------------------------------------------
 .../src/test/java/org/apache/logging/slf4j/Log4j1222Test.java       | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2490cbe5/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/Log4j1222Test.java
----------------------------------------------------------------------
diff --git a/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/Log4j1222Test.java b/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/Log4j1222Test.java
index 1e17161..59f69e0 100644
--- a/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/Log4j1222Test.java
+++ b/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/Log4j1222Test.java
@@ -16,7 +16,6 @@
  */
 package org.apache.logging.slf4j;
 
-
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;


[19/28] logging-log4j2 git commit: LOG4J2-1438 (GC) Add method getParameter() to ObjectMessage (and ReusableObjectMessage).

Posted by mi...@apache.org.
LOG4J2-1438 (GC) Add method getParameter() to ObjectMessage (and ReusableObjectMessage).


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

Branch: refs/heads/LOG4J-1181
Commit: 8803998f3f430f119ebc213c7daaf8001ea4bb90
Parents: 291fbf0
Author: rpopma <rp...@apache.org>
Authored: Sun Jul 31 16:32:06 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Jul 31 16:32:06 2016 +0900

----------------------------------------------------------------------
 .../org/apache/logging/log4j/message/ObjectMessage.java     | 9 +++++++++
 .../apache/logging/log4j/message/ReusableObjectMessage.java | 9 +++++++++
 src/changes/changes.xml                                     | 3 +++
 3 files changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8803998f/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
index 7ab9a48..40bb6d6 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
@@ -94,6 +94,15 @@ public class ObjectMessage implements Message, StringBuilderFormattable {
     }
 
     /**
+     * Returns the object parameter.
+     *
+     * @return The object.
+     */
+    public Object getParameter() {
+        return obj;
+    }
+
+    /**
      * Returns the object as if it were a parameter.
      *
      * @return The object.

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8803998f/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java
index fb3f176..ec14fbb 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/ReusableObjectMessage.java
@@ -82,6 +82,15 @@ public class ReusableObjectMessage implements ReusableMessage {
     }
 
     /**
+     * Returns the object parameter.
+     *
+     * @return The object.
+     */
+    public Object getParameter() {
+        return obj;
+    }
+
+    /**
      * Returns the object as if it were a parameter.
      *
      * @return The object.

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8803998f/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index efd8e52..da03a3e 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -24,6 +24,9 @@
   </properties>
   <body>
     <release version="2.7" date="2016-MM-DD" description="GA Release 2.7">
+      <action issue="LOG4J2-1438" dev="rpopma" type="fix">
+        (GC) Add method getParameter() to ObjectMessage (and ReusableObjectMessage).
+      </action>
       <action issue="LOG4J2-1488" dev="rpopma" type="fix" due-to="Richard Zschech">
         (GC) Fixed ISO8601 %date conversion pattern with a period '.' separator for milliseconds is now garbage free.
       </action>


[22/28] logging-log4j2 git commit: limit line lengths to 95 for announcement emails

Posted by mi...@apache.org.
limit line lengths to 95 for announcement emails


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

Branch: refs/heads/LOG4J-1181
Commit: 7191e0fb15759a8e5fc28b03bd51200dd0ae822d
Parents: 5824cc2
Author: rpopma <rp...@apache.org>
Authored: Sun Jul 31 17:51:32 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Jul 31 17:51:32 2016 +0900

----------------------------------------------------------------------
 src/changes/announcement.vm | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7191e0fb/src/changes/announcement.vm
----------------------------------------------------------------------
diff --git a/src/changes/announcement.vm b/src/changes/announcement.vm
index 632fc5b..4fdaf0a 100644
--- a/src/changes/announcement.vm
+++ b/src/changes/announcement.vm
@@ -150,14 +150,15 @@ o#if($!issue != "") $issue. #end ${action} #if($!dueto != "")Thanks to $dueto. #
 ## End of main loop
 #end
 
-Apache Log4j ${relVersion} requires a minimum of Java 7 to build and run. Log4j 2.3 was the last release that
-supported Java 6.
+Apache Log4j ${relVersion} requires a minimum of Java 7 to build and run. Log4j 2.3 was the
+last release that supported Java 6.
 
-Basic compatibility with Log4j 1.x is provided through the log4j-1.2-api component, however it does not implement some of the
-very implementation specific classes and methods. The package names and Maven groupId have been changed to
-org.apache.logging.log4j to avoid any conflicts with log4j 1.x.
+Basic compatibility with Log4j 1.x is provided through the log4j-1.2-api component, however it
+does not implement some of the very implementation specific classes and methods. The package
+names and Maven groupId have been changed to org.apache.logging.log4j to avoid any conflicts
+with log4j 1.x.
 
-For complete information on ${project.name}, including instructions on how to submit bug reports,
-patches, or suggestions for improvement, see the Apache ${project.name} website:
+For complete information on ${project.name}, including instructions on how to submit bug
+reports, patches, or suggestions for improvement, see the Apache ${project.name} website:
 
 ${project.url}
\ No newline at end of file


[07/28] logging-log4j2 git commit: Javadoc.

Posted by mi...@apache.org.
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/2acc3c21
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/2acc3c21
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/2acc3c21

Branch: refs/heads/LOG4J-1181
Commit: 2acc3c210e4ec20fc03fe1ef8ef3bec2b5c81e9e
Parents: 0a316f3
Author: Gary Gregory <gg...@apache.org>
Authored: Thu Jul 28 17:18:30 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu Jul 28 17:18:30 2016 -0700

----------------------------------------------------------------------
 .../logging/log4j/core/osgi/felix/FelixLoadCoreBundleTest.java   | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2acc3c21/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/felix/FelixLoadCoreBundleTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/felix/FelixLoadCoreBundleTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/felix/FelixLoadCoreBundleTest.java
index 524a0de..6b71487 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/felix/FelixLoadCoreBundleTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/osgi/felix/FelixLoadCoreBundleTest.java
@@ -28,6 +28,10 @@ import org.junit.Ignore;
  * <p>
  * For example, on Windows: "mvn clean package -DskipTests & mvn test"
  * </p>
+ * <p>
+ * To only test this class: {@code mvn -pl log4j-core -DskipTests clean package & mvn -pl log4j-core 
+ * -Dtest=FelixLoadCoreBundleTest test}
+ * </p>
  */
 @Ignore
 public class FelixLoadCoreBundleTest extends AbstractFelixLoadBundleTest {


[05/28] logging-log4j2 git commit: Remove comment.

Posted by mi...@apache.org.
Remove comment.

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

Branch: refs/heads/LOG4J-1181
Commit: a71d29f2f1eae534457847963b2721b4493e063f
Parents: 8fc1477
Author: Gary Gregory <gg...@apache.org>
Authored: Thu Jul 28 16:33:33 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu Jul 28 16:33:33 2016 -0700

----------------------------------------------------------------------
 .../apache/logging/log4j/core/layout/CsvParameterLayoutTest.java    | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a71d29f2/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/CsvParameterLayoutTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/CsvParameterLayoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/CsvParameterLayoutTest.java
index 280cb80..388b24a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/CsvParameterLayoutTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/CsvParameterLayoutTest.java
@@ -67,7 +67,6 @@ public class CsvParameterLayoutTest {
 
     @AfterClass
     public static void cleanupClass() {
-//        System.setProperty(Constants.LOG4J_CONTEXT_SELECTOR, null);
         ThreadContext.clearAll();
     }
 


[10/28] logging-log4j2 git commit: Add toString().

Posted by mi...@apache.org.
Add toString().

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

Branch: refs/heads/LOG4J-1181
Commit: 5f9684ff4f77ef772c75eacafdbfb7fd957db40e
Parents: 7694f14
Author: Gary Gregory <gg...@apache.org>
Authored: Thu Jul 28 17:33:59 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu Jul 28 17:33:59 2016 -0700

----------------------------------------------------------------------
 .../apache/logging/log4j/junit/OsgiRule.java    | 141 ++++++++++---------
 1 file changed, 73 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5f9684ff/log4j-api/src/test/java/org/apache/logging/log4j/junit/OsgiRule.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/junit/OsgiRule.java b/log4j-api/src/test/java/org/apache/logging/log4j/junit/OsgiRule.java
index f0378f0..8cd57f2 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/junit/OsgiRule.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/junit/OsgiRule.java
@@ -1,68 +1,73 @@
-/*
- * 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.junit;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.rules.ExternalResource;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.launch.Framework;
-import org.osgi.framework.launch.FrameworkFactory;
-
-/**
- * JUnit rule to initialize and shutdown an OSGi framework.
- */
-public class OsgiRule extends ExternalResource {
-
-    private final FrameworkFactory factory;
-    private Framework framework;
-
-    public OsgiRule(final FrameworkFactory factory) {
-        this.factory = factory;
-    }
-
-    public Framework getFramework() {
-        return framework;
-    }
-
-    @Override
-    protected void before() throws Throwable {
-        final Map<String, String> configMap = new HashMap<>(2);
-        // Cleans framework before first init. Subsequent init invocations do not clean framework.
-        configMap.put("org.osgi.framework.storage.clean", "onFirstInit");
-        // Delegates loading of endorsed libraries to JVM classloader
-        // config.put("org.osgi.framework.bootdelegation", "javax.*,org.w3c.*,org.xml.*");
-        framework = factory.newFramework(configMap);
-        framework.init();
-        framework.start();
-    }
-
-    @Override
-    protected void after() {
-        if (framework != null) {
-            try {
-                framework.stop();
-            } catch (final BundleException e) {
-                throw new RuntimeException(e);
-            } finally {
-                framework = null;
-            }
-        }
-    }
-}
+/*
+ * 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.junit;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.rules.ExternalResource;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
+
+/**
+ * JUnit rule to initialize and shutdown an OSGi framework.
+ */
+public class OsgiRule extends ExternalResource {
+
+    private final FrameworkFactory factory;
+    private Framework framework;
+
+    public OsgiRule(final FrameworkFactory factory) {
+        this.factory = factory;
+    }
+
+    public Framework getFramework() {
+        return framework;
+    }
+
+    @Override
+    protected void before() throws Throwable {
+        final Map<String, String> configMap = new HashMap<>(2);
+        // Cleans framework before first init. Subsequent init invocations do not clean framework.
+        configMap.put("org.osgi.framework.storage.clean", "onFirstInit");
+        // Delegates loading of endorsed libraries to JVM classloader
+        // config.put("org.osgi.framework.bootdelegation", "javax.*,org.w3c.*,org.xml.*");
+        framework = factory.newFramework(configMap);
+        framework.init();
+        framework.start();
+    }
+
+    @Override
+    protected void after() {
+        if (framework != null) {
+            try {
+                framework.stop();
+            } catch (final BundleException e) {
+                throw new RuntimeException(e);
+            } finally {
+                framework = null;
+            }
+        }
+    }
+
+    @Override
+    public String toString() {
+        return "OsgiRule [factory=" + factory + ", framework=" + framework + "]";
+    }
+}