You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2013/02/20 12:39:43 UTC
svn commit: r1448097 - in /commons/proper/logging/trunk/src:
changes/changes.xml
main/java/org/apache/commons/logging/impl/LogFactoryImpl.java
Author: tn
Date: Wed Feb 20 11:39:42 2013
New Revision: 1448097
URL: http://svn.apache.org/r1448097
Log:
[LOGGING-138] Add stacktrace of discovery failure to diagnostic message.
Modified:
commons/proper/logging/trunk/src/changes/changes.xml
commons/proper/logging/trunk/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java
Modified: commons/proper/logging/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/logging/trunk/src/changes/changes.xml?rev=1448097&r1=1448096&r2=1448097&view=diff
==============================================================================
--- commons/proper/logging/trunk/src/changes/changes.xml (original)
+++ commons/proper/logging/trunk/src/changes/changes.xml Wed Feb 20 11:39:42 2013
@@ -44,6 +44,10 @@ The <action> type attribute can be add,u
</properties>
<body>
<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">
Jdk14Logger now correctly uses the specified logger name.
</action>
Modified: commons/proper/logging/trunk/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/logging/trunk/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java?rev=1448097&r1=1448096&r2=1448097&view=diff
==============================================================================
--- commons/proper/logging/trunk/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java (original)
+++ commons/proper/logging/trunk/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java Wed Feb 20 11:39:42 2013
@@ -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 LogF
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());
}
}
}