camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <jimi.hulleg...@svensktnaringsliv.se>
Subject How to log a Processor ERROR with stacktrace using DeadLetterChannel?
Date Sun, 17 Apr 2016 23:56:13 GMT
Hi,



How can I log a Processor ERROR with stacktrace using DeadLetterChannel? Ie I have a route
with a Processor that throws an Exception of some kind, and the route has a DeadLetterChannel
configured, that sends the exchange to a "error" route. And I would like this Exception to
be logged on ERROR level, with stacktrace.



My setup, using Camel 2.17.0 and Camel Spring xml, looks something like this:



<errorHandler id="deadLetterErrorHandler" type="DeadLetterChannel" deadLetterUri="direct:error"
/>



<camelContext>
 <route errorHandlerRef="deadLetterErrorHandler">
  [...]
  <process ref="myProcessor" /><!-- This throws an exception in method process(Exchange)
-->
  [...]
 </route>

 <route>
  <from uri="direct:error" />

  <log logName="com.mycompany" loggingLevel="ERROR" message="Could not handle file '${file:name}'"
/>

  <to uri="log:com.mycompany?level=ERROR&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true"
/>

  [...]
 </route>
<camelContext>


The expected behaivor is that Camel logs the exception on ERROR logging level, with stacktrace.
The actual behaivor is that Camel logs the exception like this:



[...] DEBUG org.apache.camel.processor.DeadLetterChannel - Failed delivery for (MessageId:
12345 on ExchangeId: 54321). On delivery attempt: 0 caught: java.lang.IllegalArgumentException:
Exception details...



Ie it logs the exception on DEBUG log level, and without any stacktrace.



What can I do to fix this?



Regards
/Jimi

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message