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

@@ -44,6 +44,10 @@ The <action> type attribute can be add,update,fix,remove.
</properties> </properties>
<body> <body>
<release version="1.1.2" date="In SVN" description="Bug fixes."> <release version="1.1.2" date="In SVN" description="Bug fixes.">
<action type="update" issue="LOGGING-138">
In case of a discovery failure now also the stacktrace of the cause will be
added to the diagnostic message.
</action>
<action type="fix" issue="LOGGING-132"> <action type="fix" issue="LOGGING-132">
Jdk14Logger now correctly uses the specified logger name. Jdk14Logger now correctly uses the specified logger name.
</action> </action>

View File

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