1
0

[LOGGING-138] Add stacktrace of discovery failure to diagnostic message.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/logging/trunk@1448097 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart
2013-02-20 11:39:42 +00:00
parent fa3c76104f
commit 0c12cec132
2 changed files with 9 additions and 3 deletions

View File

@@ -17,6 +17,8 @@
package org.apache.commons.logging.impl;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -1272,9 +1274,9 @@ public class LogFactoryImpl extends LogFactory {
ExceptionInInitializerError eiie = (ExceptionInInitializerError)cause;
Throwable cause2 = eiie.getException();
if (cause2 != null) {
logDiagnostic("... ExceptionInInitializerError: " +
cause2.getClass().getName() + ": " +
cause2.getLocalizedMessage());
final StringWriter sw = new StringWriter();
cause2.printStackTrace(new PrintWriter(sw, true));
logDiagnostic("... ExceptionInInitializerError: " + sw.toString());
}
}
}