You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2017/10/11 15:32:28 UTC
logging-log4j2 git commit: [LOG4J2-2070 Log4j1XmlLayout does not
provide the entire stack trace, it is missing the caused by information.
Repository: logging-log4j2
Updated Branches:
refs/heads/master 5f99a5d05 -> f7664b6fd
[LOG4J2-2070 Log4j1XmlLayout does not provide the entire stack trace, it
is missing the caused by information.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f7664b6f
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f7664b6f
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f7664b6f
Branch: refs/heads/master
Commit: f7664b6fd2cefd831e56127d7635b61ee70bb7c8
Parents: 5f99a5d
Author: Doug Hughes <do...@hotmail.com>
Authored: Wed Oct 11 09:32:25 2017 -0600
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Oct 11 09:32:25 2017 -0600
----------------------------------------------------------------------
.../java/org/apache/log4j/layout/Log4j1XmlLayout.java | 14 ++++++--------
src/changes/changes.xml | 3 +++
2 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f7664b6f/log4j-1.2-api/src/main/java/org/apache/log4j/layout/Log4j1XmlLayout.java
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/layout/Log4j1XmlLayout.java b/log4j-1.2-api/src/main/java/org/apache/log4j/layout/Log4j1XmlLayout.java
index 10a872c..9522b9e 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/layout/Log4j1XmlLayout.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/layout/Log4j1XmlLayout.java
@@ -16,6 +16,8 @@
*/
package org.apache.log4j.layout;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
import java.util.List;
@@ -107,16 +109,12 @@ public final class Log4j1XmlLayout extends AbstractStringLayout {
}
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
- final
- Throwable thrown = event.getThrown();
+ final Throwable thrown = event.getThrown();
if (thrown != null) {
buf.append("<log4j:throwable><![CDATA[");
- buf.append(thrown.toString());
- buf.append("\r\n");
- for (final StackTraceElement element : thrown.getStackTrace()) {
- Transform.appendEscapingCData(buf, "\tat " + element.toString());
- buf.append("\r\n");
- }
+ final StringWriter w = new StringWriter();
+ thrown.printStackTrace(new PrintWriter(w));
+ Transform.appendEscapingCData(buf, w.toString());
buf.append("]]></log4j:throwable>\r\n");
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f7664b6f/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index d73d54c..cd42972 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -65,6 +65,9 @@
<action issue="LOG4J2-1216" dev="ggregory" type="fix" due-to="Thies Wellpott, Barna Zsombor Klara">
Nested pattern layout options broken.
</action>
+ <action issue="LOG4J2-2070" dev="ggregory" type="fix" due-to="Doug Hughes">
+ Log4j1XmlLayout does not provide the entire stack trace, it is missing the caused by information.
+ </action>
</release>
<release version="2.9.1" date="2017-09-17" description="GA Release 2.9.1">
<action issue="LOG4J2-1988" dev="rpopma" type="fix">