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: Can camel use a Marker as used in logback?
Date Wed, 02 Nov 2011 11:57:18 GMT
Hi Ceki

Thanks for the details.

Michael feel free to create a JIRA ticket for this improvement. Seems
like it should be possible with slf4j API to support markers in the
DSL.
As we love contributions you are of course welcome to work on a patch as well.
http://camel.apache.org/contributing.html


On Wed, Nov 2, 2011 at 10:46 AM, ceki <ceki@qos.ch> wrote:
>
> Hi all,
>
> Since markers are part of SLF4J's public API, you can invoke logger
> print method with markers.
>
> As Michael mentioned you can write:
>
>  Marker blueMarker = MarkerFactory.getMarker( "blue" );
>  logger.warn( blueMarker , "my log message" );
>
> If logback is the underlying logging framework, SLF4J will invoke
> logback handing it the blueMarker as well as the "log message" along
> with other relevant data. For other logging systems, the marker will
> be ignored. Assuming logback is the underlying logging framework, the
> user is free to filter log events based on the available marker data.
>
> While Camel should not assume that logback is the underlying logging
> framework, it can log with markers if the user asks it to do so.
>
> Here is an example:
>
> <camel:log message="Received message"
>           logName="com.app.CamelReport"
>           marker="someRouteDependentValue"
>           loggingLevel="INFO"/>
>
>
>
> Here I am assuming that <camel:log> is part of a route definition
> where "someRouteDependentValue" is known in that context. This would
> allow the user to log messages based on the route. It's just an
> example. I know very little about camel so this example might not make
> sense.
>
> Regardless of whether logback is the underlying framework, SLF4J api
> allows you to log with marker data. The marker data can be put to use
> by logback and will be ignored by other frameworks.
>
> Best regards,
>
> --
> Ceki
> http://twitter.com/#!/ceki
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message