logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nickwilli...@apache.org
Subject svn commit: r1483407 - in /logging/log4j/log4j2/trunk: ./ core/ core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ core/src/main/java/org/apache/logging/log4j/core/config/ core/src/site/xdoc/ src/site/xdoc/manual/
Date Thu, 16 May 2013 15:24:54 GMT
Author: nickwilliams
Date: Thu May 16 15:24:53 2013
New Revision: 1483407

URL: http://svn.apache.org/r1483407
Log:
Upgrading from Jackson Mapper 1.9.11 to Jackson Data Processor 2.2.1.

Modified:
    logging/log4j/log4j2/trunk/core/pom.xml
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextMapJsonAttributeConverter.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextStackJsonAttributeConverter.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/package-info.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfiguration.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfigurationFactory.java
    logging/log4j/log4j2/trunk/core/src/site/xdoc/index.xml
    logging/log4j/log4j2/trunk/pom.xml
    logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml.vm

Modified: logging/log4j/log4j2/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/pom.xml?rev=1483407&r1=1483406&r2=1483407&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/pom.xml (original)
+++ logging/log4j/log4j2/trunk/core/pom.xml Thu May 16 15:24:53 2013
@@ -48,13 +48,13 @@
       <optional>true</optional>
     </dependency>
     <dependency>
-      <groupId>org.codehaus.jackson</groupId>
-      <artifactId>jackson-core-asl</artifactId>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-core</artifactId>
       <optional>true</optional>
     </dependency>
     <dependency>
-      <groupId>org.codehaus.jackson</groupId>
-      <artifactId>jackson-mapper-asl</artifactId>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
       <optional>true</optional>
     </dependency>
     <dependency>

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextMapJsonAttributeConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextMapJsonAttributeConverter.java?rev=1483407&r1=1483406&r2=1483407&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextMapJsonAttributeConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextMapJsonAttributeConverter.java
Thu May 16 15:24:53 2013
@@ -16,20 +16,21 @@
  */
 package org.apache.logging.log4j.core.appender.db.jpa.converter;
 
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.type.TypeReference;
-
-import javax.persistence.AttributeConverter;
-import javax.persistence.PersistenceException;
 import java.io.IOException;
 import java.util.Map;
+import javax.persistence.AttributeConverter;
+import javax.persistence.PersistenceException;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
 
 /**
  * A JPA 2.1 attribute converter for {@link Map Map&lt;String, String&gt;}s in
  * {@link org.apache.logging.log4j.core.LogEvent}s. This converter is capable of converting
both to and from
  * {@link String}s.
  *
- * In addition to other optional dependencies required by the JPA appender, this converter
requires the Jackson Mapper.
+ * In addition to other optional dependencies required by the JPA appender, this converter
requires the Jackson Data
+ * Processor.
  */
 public class ContextMapJsonAttributeConverter implements AttributeConverter<Map<String,
String>, String> {
     static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextStackJsonAttributeConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextStackJsonAttributeConverter.java?rev=1483407&r1=1483406&r2=1483407&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextStackJsonAttributeConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextStackJsonAttributeConverter.java
Thu May 16 15:24:53 2013
@@ -16,20 +16,22 @@
  */
 package org.apache.logging.log4j.core.appender.db.jpa.converter;
 
-import org.apache.logging.log4j.ThreadContext;
-import org.codehaus.jackson.type.TypeReference;
-
-import javax.persistence.AttributeConverter;
-import javax.persistence.PersistenceException;
 import java.io.IOException;
 import java.util.List;
+import javax.persistence.AttributeConverter;
+import javax.persistence.PersistenceException;
+
+import org.apache.logging.log4j.ThreadContext;
+
+import com.fasterxml.jackson.core.type.TypeReference;
 
 /**
  * A JPA 2.1 attribute converter for {@link ThreadContext.ContextStack}s in
  * {@link org.apache.logging.log4j.core.LogEvent}s. This converter is capable of converting
both to and from
  * {@link String}s.
  *
- * In addition to other optional dependencies required by the JPA appender, this converter
requires the Jackson Mapper.
+ * In addition to other optional dependencies required by the JPA appender, this converter
requires the Jackson Data
+ * Processor.
  */
 public class ContextStackJsonAttributeConverter implements AttributeConverter<ThreadContext.ContextStack,
String> {
     @Override

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/package-info.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/package-info.java?rev=1483407&r1=1483406&r2=1483407&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/package-info.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/converter/package-info.java
Thu May 16 15:24:53 2013
@@ -20,6 +20,6 @@
  * entities. The {@link ContextMapAttributeConverter} and {@link ContextStackAttributeConverter}
only support
  * persistence and not retrieval, persisting the type as a simple string. You can use the
  * {@link ContextMapJsonAttributeConverter} and {@link ContextStackJsonAttributeConverter}
instead, which require the
- * Jackson Mapper dependency to also be on your class path.
+ * Jackson Data Processor dependency to also be on your class path.
  */
 package org.apache.logging.log4j.core.appender.db.jpa.converter;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfiguration.java?rev=1483407&r1=1483406&r2=1483407&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfiguration.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfiguration.java
Thu May 16 15:24:53 2013
@@ -16,19 +16,6 @@
  */
 package org.apache.logging.log4j.core.config;
 
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.core.config.plugins.PluginManager;
-import org.apache.logging.log4j.core.config.plugins.PluginType;
-import org.apache.logging.log4j.core.config.plugins.ResolverUtil;
-import org.apache.logging.log4j.core.helpers.FileUtils;
-import org.apache.logging.log4j.core.net.Advertiser;
-import org.apache.logging.log4j.status.StatusConsoleListener;
-import org.apache.logging.log4j.status.StatusListener;
-import org.apache.logging.log4j.status.StatusLogger;
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.map.ObjectMapper;
-
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
@@ -47,6 +34,20 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.core.config.plugins.PluginManager;
+import org.apache.logging.log4j.core.config.plugins.PluginType;
+import org.apache.logging.log4j.core.config.plugins.ResolverUtil;
+import org.apache.logging.log4j.core.helpers.FileUtils;
+import org.apache.logging.log4j.core.net.Advertiser;
+import org.apache.logging.log4j.status.StatusConsoleListener;
+import org.apache.logging.log4j.status.StatusListener;
+import org.apache.logging.log4j.status.StatusLogger;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
 /**
  * Creates a Node hierarchy from a JSON file.
  */
@@ -80,7 +81,7 @@ public class JSONConfiguration extends B
             final ObjectMapper mapper = new ObjectMapper().configure(JsonParser.Feature.ALLOW_COMMENTS,
true);
             root = mapper.readTree(is);
             if (root.size() == 1) {
-                final Iterator<JsonNode> i = root.getElements();
+                final Iterator<JsonNode> i = root.elements();
                 root = i.next();
             }
             processAttributes(rootNode, root);
@@ -188,7 +189,7 @@ public class JSONConfiguration extends B
 
     @Override
     public void setup() {
-        final Iterator<Map.Entry<String, JsonNode>> iter = root.getFields();
+        final Iterator<Map.Entry<String, JsonNode>> iter = root.fields();
         final List<Node> children = rootNode.getChildren();
         while (iter.hasNext()) {
             final Map.Entry<String, JsonNode> entry = iter.next();
@@ -231,7 +232,7 @@ public class JSONConfiguration extends B
         final PluginType<?> type = getPluginManager().getPluginType(name);
         final Node node = new Node(parent, name, type);
         processAttributes(node, jsonNode);
-        final Iterator<Map.Entry<String, JsonNode>> iter = jsonNode.getFields();
+        final Iterator<Map.Entry<String, JsonNode>> iter = jsonNode.fields();
         final List<Node> children = node.getChildren();
         while (iter.hasNext()) {
             final Map.Entry<String, JsonNode> entry = iter.next();
@@ -252,7 +253,7 @@ public class JSONConfiguration extends B
                         } else {
                             LOGGER.debug("Processing " + pluginType + " " + entry.getKey()
+ "[" + i + "]");
                         }
-                        final Iterator<Map.Entry<String, JsonNode>> itemIter
= n.get(i).getFields();
+                        final Iterator<Map.Entry<String, JsonNode>> itemIter
= n.get(i).fields();
                         final List<Node> itemChildren = item.getChildren();
                         while (itemIter.hasNext()) {
                             final Map.Entry<String, JsonNode> itemEntry = itemIter.next();
@@ -284,7 +285,7 @@ public class JSONConfiguration extends B
     }
 
     private String getType(final JsonNode node, final String name) {
-        final Iterator<Map.Entry<String, JsonNode>> iter = node.getFields();
+        final Iterator<Map.Entry<String, JsonNode>> iter = node.fields();
         while (iter.hasNext()) {
             final Map.Entry<String, JsonNode> entry = iter.next();
             if (entry.getKey().equalsIgnoreCase("type")) {
@@ -299,7 +300,7 @@ public class JSONConfiguration extends B
 
     private void processAttributes(final Node parent, final JsonNode node) {
         final Map<String, String> attrs = parent.getAttributes();
-        final Iterator<Map.Entry<String, JsonNode>> iter = node.getFields();
+        final Iterator<Map.Entry<String, JsonNode>> iter = node.fields();
         while (iter.hasNext()) {
             final Map.Entry<String, JsonNode> entry = iter.next();
             if (!entry.getKey().equalsIgnoreCase("type")) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfigurationFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfigurationFactory.java?rev=1483407&r1=1483406&r2=1483407&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfigurationFactory.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfigurationFactory.java
Thu May 16 15:24:53 2013
@@ -16,9 +16,10 @@
  */
 package org.apache.logging.log4j.core.config;
 
-import org.apache.logging.log4j.core.config.plugins.Plugin;
 import java.io.File;
 
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+
 /**
  *
  */
@@ -32,8 +33,9 @@ public class JSONConfigurationFactory ex
     public static final String[] SUFFIXES = new String[] {".json", ".jsn"};
 
     private static String[] dependencies = new String[] {
-        "org.codehaus.jackson.JsonNode",
-        "org.codehaus.jackson.map.ObjectMapper"
+            "com.fasterxml.jackson.databind.ObjectMapper",
+            "com.fasterxml.jackson.databind.JsonNode",
+            "com.fasterxml.jackson.core.JsonParser"
     };
 
     private final File configFile = null;

Modified: logging/log4j/log4j2/trunk/core/src/site/xdoc/index.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/site/xdoc/index.xml?rev=1483407&r1=1483406&r2=1483407&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/site/xdoc/index.xml (original)
+++ logging/log4j/log4j2/trunk/core/src/site/xdoc/index.xml Thu May 16 15:24:53 2013
@@ -39,7 +39,7 @@
                 documentation for those features.
             </p>
             <ul>
-                <li>JSON configuration requires the Jackson JSON-processor.</li>
+                <li>JSON configuration requires the Jackson Data Processor.</li>
                 <li>Async Loggers require the LMAX Disruptor.</li>
                 <li>SMTPAppender requires Javax Mail.</li>
                 <li>JMSQueueAppender and JMSTopicAppender require a JMS implementation
like

Modified: logging/log4j/log4j2/trunk/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/pom.xml?rev=1483407&r1=1483406&r2=1483407&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/pom.xml (original)
+++ logging/log4j/log4j2/trunk/pom.xml Thu May 16 15:24:53 2013
@@ -136,7 +136,7 @@
     <log4jParentDir>${basedir}</log4jParentDir>
     <Log4jReleaseVersion>2.0-beta6</Log4jReleaseVersion>
     <Log4jReleaseCount>eighth</Log4jReleaseCount>
-    <jackson.version>1.9.11</jackson.version>
+    <jackson.version>2.2.1</jackson.version>
     <disruptor.version>3.0.1</disruptor.version>
     <!-- Configuration properties for the OSGi maven-bundle-plugin -->
     <osgi.symbolicName>org.apache.logging.${project.artifactId}</osgi.symbolicName>
@@ -251,14 +251,14 @@
         <optional>true</optional>
       </dependency>
       <dependency>
-        <groupId>org.codehaus.jackson</groupId>
-        <artifactId>jackson-core-asl</artifactId>
+        <groupId>com.fasterxml.jackson.core</groupId>
+        <artifactId>jackson-core</artifactId>
         <version>${jackson.version}</version>
         <optional>true</optional>
       </dependency>
       <dependency>
-        <groupId>org.codehaus.jackson</groupId>
-        <artifactId>jackson-mapper-asl</artifactId>
+        <groupId>com.fasterxml.jackson.core</groupId>
+        <artifactId>jackson-databind</artifactId>
         <version>${jackson.version}</version>
         <optional>true</optional>
       </dependency>

Modified: logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml.vm
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml.vm?rev=1483407&r1=1483406&r2=1483407&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml.vm (original)
+++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml.vm Thu May 16 15:24:53
2013
@@ -593,19 +593,19 @@ public class Bar {
   }
 }</pre>
           <p>
-            The JSON support uses Jackson to parse the JSON files. These dependencies must
be added to a project
-            that wants to use JSON for configuration:
+            The JSON support uses the Jackson Data Processor to parse the JSON files. These
dependencies must be added
+            to a project that wants to use JSON for configuration:
           <pre class="prettyprint linenums"><![CDATA[
 <dependency>
-  <groupId>org.codehaus.jackson</groupId>
-  <artifactId>jackson-core-asl</artifactId>
-  <version>1.9.2</version>
+  <groupId>com.fasterxml.jackson.core</groupId>
+  <artifactId>jackson-core</artifactId>
+  <version>2.2.1</version>
 </dependency>
 
 <dependency>
-  <groupId>org.codehaus.jackson</groupId>
-  <artifactId>jackson-mapper-asl</artifactId>
-  <version>1.9.2</version>
+  <groupId>com.fasterxml.jackson.core</groupId>
+  <artifactId>jackson-databind</artifactId>
+  <version>2.2.1</version>
 </dependency>]]></pre>
           </p>
         <a name="Loggers"/>



Mime
View raw message