camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller <>
Subject Re: Custom logging of exceptions by file component
Date Wed, 03 Jul 2013 19:49:40 GMT
Check out the following links:


Software Integration Specialist

Apache Camel committer:
V.P. Apache Camel:
Apache Member:

On Wed, Jul 3, 2013 at 3:51 PM, Nuno Santos <> wrote:

> Hello everyone,
> I'm using the Camel File component to monitor a directory for any file
> written there and upload them to a server. Once a file is uploaded, it is
> moved to a different directory. If the upload attempt fails, the file is
> left in place and another attempt is made to upload it in the next poll
> cycle of the File component. The code looks like this:
> fromF("file://%s", directory)
>   .process(new Processor() {
>     @Override
>     public void process(Exchange exchange) throws Exception {
>       // try to upload to a web server. Throw exception if failed
>     });
> This is working fine except that whenever an upload fails, camel logs a
> message with a large stack trace. This means that every second or so the
> log
> files grow by a couple of hundreds of lines, which is not ideal. I want to
> do custom logging of this message, eg., print a single line with a short
> message for each attempt. But so far, I haven't found a way of doing this.
> If I add a custom error handler to the route above and mark the exception
> as
> handled, the file component thinks that everything succeeded and deletes
> the
> file. If I don't mark it as handled, the exception will still be logged by
> the file component after it rollsback. Is it possible to change the way
> that
> the File component logs these exceptions?
> Thank you advance
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

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