Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ABD0C986B for ; Wed, 2 Nov 2011 11:58:06 +0000 (UTC) Received: (qmail 97010 invoked by uid 500); 2 Nov 2011 11:58:06 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 96981 invoked by uid 500); 2 Nov 2011 11:58:06 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 96970 invoked by uid 99); 2 Nov 2011 11:58:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Nov 2011 11:58:05 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.215.173 as permitted sender) Received: from [209.85.215.173] (HELO mail-ey0-f173.google.com) (209.85.215.173) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Nov 2011 11:58:01 +0000 Received: by eyh6 with SMTP id 6so43903eyh.32 for ; Wed, 02 Nov 2011 04:57:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=Z2Y4vOTvxuoV6rjfQw1a2KGvMJjGy9OvzuQpNoxBHE4=; b=dmy70DMWDhJafF2plKeDRO9s+YOtuzG/R2gCzQCScYZPoUpaLGIoeEXbbjwDFA+eRx mhaekV5mTKI4HD33QSTD9PJOQN0DM9tvBXaL6wy5qNewR6LBE7zisrYYgGW6le4ooK/8 zS4cMtYXjWWbGnI7ZB9qGbuynDzcwlmLCSHPQ= Received: by 10.14.16.143 with SMTP id h15mr257486eeh.47.1320235059776; Wed, 02 Nov 2011 04:57:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.14.97.7 with HTTP; Wed, 2 Nov 2011 04:57:18 -0700 (PDT) In-Reply-To: <4EB1115F.6000808@qos.ch> References: <4EB1115F.6000808@qos.ch> From: Claus Ibsen Date: Wed, 2 Nov 2011 12:57:18 +0100 Message-ID: Subject: Re: Can camel use a Marker as used in logback? To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 we= ll. http://camel.apache.org/contributing.html On Wed, Nov 2, 2011 at 10:46 AM, ceki 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: > > =A0Marker blueMarker =3D MarkerFactory.getMarker( "blue" ); > =A0logger.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: > > =A0 =A0 =A0 =A0 =A0 logName=3D"com.app.CamelReport" > =A0 =A0 =A0 =A0 =A0 marker=3D"someRouteDependentValue" > =A0 =A0 =A0 =A0 =A0 loggingLevel=3D"INFO"/> > > > > Here I am assuming that 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 > --=20 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/