Yes, just like Christian says. Use a different logging category for each
route.

You can customise the logging category of your LoggingErrorHandler like
described here [1]. It may be worth externalising their names to a
properties file.

Once you have different logging categories, just set up the appropriate
logging appenders in your log4j config (or similar).

As a last piece of advanced advice, if you are using MDC logging either
inside OSGi or outside, you get separate logs for free with the
org.apache.log4j.sift.MDCSiftingAppender and the appropriate MDC key in the
filename. Camel populates the MDC keys specified here: [2]. One of these
keys is the route ID.

[1]
http://camel.apache.org/error-handler.html#ErrorHandler-LoggingErrorHandler
[2] http://camel.apache.org/mdc-logging.html

Hope that helps,

*Raúl Kripalani*
Apache Camel Committer
Enterprise Architect, Program Manager, Open Source Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk>

On Mon, Nov 5, 2012 at 11:12 PM, Christian Müller <
[email protected]> wrote:

> You can configure log4j to use different log files for different
> packages/classes.
>
> Best,
> Christian
>
> On Mon, Nov 5, 2012 at 10:22 PM, maheshadepu <[email protected]>
> wrote:
>
> > Hi All,
> >
> > Is it possible to log each route in a separate file?
> > Right now I have enabled logging(errorhandler) for  all routes.
> > So all routes logs go into a single log file?
> > But I want to log each route separately.
> >
> > Thanks,
> > Mahesh
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/logging-error-Handler-per-each-route-tp5722178.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
>
> --
>

Reply via email to