You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2009/11/17 02:23:35 UTC
svn commit: r881082 - in /cxf/branches/2.1.x-fixes: ./
api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
Author: dkulp
Date: Tue Nov 17 01:23:35 2009
New Revision: 881082
URL: http://svn.apache.org/viewvc?rev=881082&view=rev
Log:
Merged revisions 881002 via svnmerge from
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes
................
r881002 | dkulp | 2009-11-16 17:12:43 -0500 (Mon, 16 Nov 2009) | 10 lines
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.1.x-fixes/ (props changed)
cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java?rev=881082&r1=881081&r2=881082&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java (original)
+++ cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java Tue Nov 17 01:23:35 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);
}
}