camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fordm <>
Subject Customised Logging of Camel Route Errors and Exceptions
Date Tue, 17 Sep 2013 15:39:34 GMT

We use pattern matching to tail our log files for error messages of the

matching on "MY_ERROR_CODE_", emails are then sent automatically.

I therefore need any exceptions in a camel route to be log in such a format.
I'd be interested in your views on the following solution:

Create an exception handler class which will wrap and re-throw the
exception, e.g.

where MyRuntimeException is a class and MyErrorCode is an enum that will log
an error message in the required format (this is a legacy bit of code).

In blueprint.xml I define an exception handler bean, camel context and a
couple of error handlers thus (some code omitted for brevity):

This seems to work but is it utter rubbish? What's a better solution? Thanks
for any comments.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message