camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: logging(error Handler) per each route
Date Tue, 06 Nov 2012 07:27:17 GMT
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 <raul@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 <maheshadepu@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

Mime
View raw message