Author: dkulp
Date: Mon Nov 16 22:12:43 2009
New Revision: 881002
URL: http://svn.apache.org/viewvc?rev=881002&view=rev
Log:
Merged revisions 880990 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r880990 | dkulp | 2009-11-16 17:03:40 -0500 (Mon, 16 Nov 2009) | 2 lines
[CXF-2538] Add more info to the logged messages
Modified patch from Cyrille Le Clerc applied
........
Modified:
cxf/branches/2.2.x-fixes/ (props changed)
cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java?rev=881002&r1=881001&r2=881002&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
(original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
Mon Nov 16 22:12:43 2009
@@ -35,8 +35,11 @@
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.interceptor.Interceptor;
import org.apache.cxf.interceptor.InterceptorChain;
+import org.apache.cxf.message.Exchange;
import org.apache.cxf.message.FaultMode;
import org.apache.cxf.message.Message;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.model.OperationInfo;
import org.apache.cxf.transport.MessageObserver;
/**
@@ -247,11 +250,27 @@
faultOccurred = true;
+ StringBuilder description = new StringBuilder();
+ if (message.getExchange() != null) {
+ Exchange exchange = message.getExchange();
+ Service service = exchange.get(Service.class);
+ if (service != null) {
+ description.append('\'');
+ description.append(service.getName());
+ OperationInfo opInfo = exchange.get(OperationInfo.class);
+ if (opInfo != null) {
+ description.append("#").append(opInfo.getName());
+ }
+ description.append("\' ");
+ }
+ }
+
FaultMode mode = message.get(FaultMode.class);
if (mode == FaultMode.CHECKED_APPLICATION_FAULT) {
if (LOG.isLoggable(Level.FINE)) {
LogUtils.log(LOG, Level.FINE,
- "Application has thrown exception, unwinding
now", ex);
+ "Application " + description
+ + "has thrown exception, unwinding now", ex);
} else if (LOG.isLoggable(Level.INFO)) {
Throwable t = ex;
if (ex instanceof Fault
@@ -260,17 +279,20 @@
}
LogUtils.log(LOG, Level.INFO,
- "Application has thrown exception, unwinding
now: "
+ "Application " + description
+ + "has thrown exception, unwinding now: "
+ t.getClass().getName()
+ ": " + ex.getMessage());
}
} else if (LOG.isLoggable(Level.WARNING)) {
if (mode == FaultMode.UNCHECKED_APPLICATION_FAULT) {
LogUtils.log(LOG, Level.WARNING,
- "Application has thrown exception, unwinding
now", ex);
+ "Application " + description
+ + "has thrown exception, unwinding now", ex);
} else {
LogUtils.log(LOG, Level.WARNING,
- "Interceptor has thrown exception, unwinding
now", ex);
+ "Interceptor for " + description
+ + "has thrown exception, unwinding now", ex);
}
}
|