logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1483433 - in /logging/log4j/log4j2/trunk: core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java src/changes/changes.xml
Date Thu, 16 May 2013 16:12:58 GMT
Author: ggregory
Date: Thu May 16 16:12:58 2013
New Revision: 1483433

URL: http://svn.apache.org/r1483433
Log:
[LOG4J2-260] XML layout does not specify charset in content type.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java?rev=1483433&r1=1483432&r2=1483433&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java
Thu May 16 16:12:58 2013
@@ -239,7 +239,7 @@ public class XMLLayout extends AbstractS
      * @return The content type.
      */
     public String getContentType() {
-        return "text/xml";
+        return "text/xml; charset=" + this.getCharset();
     }
 
     List<String> getThrowableString(final Throwable throwable) {

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java?rev=1483433&r1=1483432&r2=1483433&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java
Thu May 16 16:12:58 2013
@@ -59,6 +59,12 @@ public class XMLLayoutTest {
     Logger root = ctx.getLogger("");
 
     @Test
+    public void testContentType() {
+        final XMLLayout layout = XMLLayout.createLayout(null, null, null, null);
+        assertEquals("text/xml; charset=UTF-8", layout.getContentType());
+    }
+
+    @Test
     public void testDefaultCharset() {
         final XMLLayout layout = XMLLayout.createLayout(null, null, null, null);
         assertEquals(Charsets.UTF_8, layout.getCharset());

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1483433&r1=1483432&r2=1483433&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Thu May 16 16:12:58 2013
@@ -22,6 +22,9 @@
   </properties>
   <body>
     <release version="2.0-beta7" date="2013-??-??" description="Bug fixes and enhancements">
+      <action issue="LOG4J2-260" dev="ggregory" type="fix">
+        XML layout does not specify charset in content type.
+      </action>
       <action issue="LOG4J2-259" dev="ggregory" type="fix">
         HTML layout does not specify charset in content type.
       </action>



Mime
View raw message