Skip to content

Commit 7802602

Browse files
committed
Added logging of cause of Throwable in LogUtil as suggested by Charles Briquel on mailing list.
1 parent c5b2d4a commit 7802602

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

quickfixj-core/src/main/java/quickfix/LogUtil.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public static void logThrowable(Log log, String message, Throwable t) {
4343
final PrintWriter printWriter = new PrintWriter(stringWriter);
4444
printWriter.println(message);
4545
t.printStackTrace(printWriter);
46+
if (t.getCause() != null) {
47+
printWriter.println("Cause: " + t.getCause().getMessage());
48+
t.getCause().printStackTrace(printWriter);
49+
}
4650
log.onErrorEvent(stringWriter.toString());
4751
}
4852

0 commit comments

Comments
 (0)