You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by maheshadepu <ma...@gmail.com> on 2012/11/05 22:22:48 UTC

logging(error Handler) per each route

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.

RE: logging(error Handler) per each route

Posted by Ra...@cognizant.com.
Yes.Log separately. We used a separate JMS Queue (JMS Appender ) for logging.

-----Original Message-----
From: maheshadepu [mailto:maheshadepu@gmail.com]
Sent: Tuesday, November 06, 2012 2:53 AM
To: users@camel.apache.org
Subject: logging(error Handler) per each route

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.
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful.

Re: logging(error Handler) per each route

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

The Fuse ESB doc have some details about the shift appenders and how
to log per application
http://fusesource.com/docs/esbent/7.0/esb_runtime/ESBRuntimeLoggingApplications.html

You can then as Raul said also do it per route, using the routeId key.

See the MDC logging here
http://camel.apache.org/mdc-logging.html

And mind that the Camel MDC keys has changed from Camel 2.10 onwards.


On Tue, Nov 6, 2012 at 2:17 AM, Raul Kripalani <ra...@evosent.com> wrote:
> 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 <
> christian.mueller@gmail.com> 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 <ma...@gmail.com>
>> 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.
>> >
>>
>>
>>
>> --
>>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: logging(error Handler) per each route

Posted by Raul Kripalani <ra...@evosent.com>.
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 <
christian.mueller@gmail.com> 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 <ma...@gmail.com>
> 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.
> >
>
>
>
> --
>

Re: logging(error Handler) per each route

Posted by Christian Müller <ch...@gmail.com>.
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 <ma...@gmail.com> 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.
>



--