logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1401175 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
Date Tue, 23 Oct 2012 06:28:41 GMT
Author: rgoers
Date: Tue Oct 23 06:28:41 2012
New Revision: 1401175

URL: http://svn.apache.org/viewvc?rev=1401175&view=rev
Log:
HTMLLayout will replace LINE_SEP or newline on Windows

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java?rev=1401175&r1=1401174&r2=1401175&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
Tue Oct 23 06:28:41 2012
@@ -49,6 +49,8 @@ public final class HTMLLayout extends Ab
 
     private static final String LINE_SEP = System.getProperty("line.separator");
 
+    private static final String REGEXP = LINE_SEP.equals("\n") ? "\n" : LINE_SEP + "|\n";
+
     private static final String DEFAULT_TITLE = "Log4J Log Messages";
 
     private static final String DEFAULT_CONTENT_TYPE = "text/html";
@@ -157,7 +159,7 @@ public final class HTMLLayout extends Ab
         }
 
         sbuf.append("<td title=\"Message\">");
-        sbuf.append(Transform.escapeTags(event.getMessage().getFormattedMessage()).replaceAll(LINE_SEP,
"<br />"));
+        sbuf.append(Transform.escapeTags(event.getMessage().getFormattedMessage()).replaceAll(REGEXP,
"<br />"));
         sbuf.append("</td>").append(LINE_SEP);
         sbuf.append("</tr>").append(LINE_SEP);
 



Mime
View raw message