Fixed log to show complete stack trace.

This commit is contained in:
Oliver Spohngellert
2016-03-31 11:27:52 -04:00
parent 8496cf0ea8
commit d4e77f6687
@@ -90,17 +90,21 @@ public final class Logger extends java.util.logging.Logger {
fileHandler.setFormatter(new Formatter() {
@Override
public String format(LogRecord record) {
if (record.getThrown() != null) {
Throwable thrown = record.getThrown();
if (thrown != null) {
String stackTrace = ""; //NON-NLS
for (StackTraceElement traceElem : record.getThrown().getStackTrace()) {
stackTrace += "\t" + traceElem.toString() + "\n"; //NON-NLS
while (thrown != null) {
stackTrace += thrown.toString() + "\n";
for (StackTraceElement traceElem : record.getThrown().getStackTrace()) {
stackTrace += "\t" + traceElem.toString() + "\n"; //NON-NLS
}
thrown = thrown.getCause();
}
return (new Timestamp(record.getMillis())).toString() + " " //NON-NLS
+ record.getSourceClassName() + " " //NON-NLS
+ record.getSourceMethodName() + "\n" //NON-NLS
+ record.getLevel() + ": " //NON-NLS
+ this.formatMessage(record) + "\n" //NON-NLS
+ record.getThrown().toString() + ":\n" //NON-NLS
+ stackTrace
+ "\n"; //NON-NLS
} else {