Quantcast

Logging cxfrs payload on exception

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Logging cxfrs payload on exception

Preben.Asmussen
I'm starting to use cxfrs component and have a question regarding logging the response payload in case of an error calling a rest service (responsecode 500).

Currently only the get something like:
[d #0 - JmsConsumer[MOSART_HUB]] EndpointMessageListener        ERROR Caused by: [org.apache.camel.RuntimeCamelException - org.apache.camel.component.cxf.CxfOperationException: JAXRS operation failed invoking hubQueue://queue:MOSART_HUB with statusCode: 500]
org.apache.camel.RuntimeCamelException: org.apache.camel.component.cxf.CxfOperationException: JAXRS operation failed invoking hubQueue://queue:MOSART_HUB with statusCode: 500
        at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1196)
        at org.apache.camel.spring.spi.TransactionErrorHandler$1.doInTransactionWithoutResult(TransactionErrorHandler.java:173)
        at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
        at org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:159)
        at org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:120)
        at org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:94)
        at org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:103)
        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)


I would like to have the full request and response payload logged as well something that the CXF loggingfeature provides.

Is there any way to configure the loggingfeature only to  log in case of an exception on the route, or do i have to set my own onException handler just to log ?

camel version 2.9.0

cheers
 
preben
Loading...