Skip to content

Commit

Permalink
BZ797: Add fix for logging nested exception traces
Browse files Browse the repository at this point in the history
  • Loading branch information
rnc committed Jun 17, 2013
1 parent c0ddff3 commit 9a53e13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions doc/REL_NOTES
Expand Up @@ -68,6 +68,7 @@ This Release
- Add integration test suite for JacORB ImR.
- Default logging now supports showing class & method information.
- Support compiling with IBM JDK 1.6/1.7.
- Fix logging for nested exception traces.
- IDL
- Fix for line endings in generated code (BZ942)

Expand Down
14 changes: 6 additions & 8 deletions src/org/jacorb/config/JacORBLogFormatter.java
Expand Up @@ -3,7 +3,7 @@
/*
* JacORB - a free Java ORB
*
* Copyright (C) 1997-2012 Gerald Brose / The JacORB Team.
* Copyright (C) 1997-2013 Gerald Brose / The JacORB Team.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
Expand All @@ -21,6 +21,8 @@
* MA 02110-1301, USA.
*/

import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.logging.Formatter;
Expand Down Expand Up @@ -69,13 +71,9 @@ public String format (LogRecord record)

private String getStackTrace (Throwable t)
{
StringBuffer result = new StringBuffer();
for (StackTraceElement ste : t.getStackTrace()) {
result.append (" ");
result.append (ste.toString());
result.append ("\n");
}
return result.toString();
StringWriter sw = new StringWriter();
t.printStackTrace(new PrintWriter (sw));
return sw.toString();
}

}

0 comments on commit 9a53e13

Please sign in to comment.