You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2013/09/01 10:39:10 UTC

Re: Logging into the bundle log file via to("log:...")

Hi

Yeah wonder if we could improve this in Camel, so .to("log:xxx") and
.log("foo") uses a logger created by the application bundle.

So if we let the application bundles classloader try to load the
logger as a class, and use that? Well we could try to experiment. Then
by default it still runs normally for end users, but for ppl using
that shift appender then the pax-logger framework may be able to
figure out the logger class is from the application bundle, and not
from camel-core bundle.





On Fri, Aug 30, 2013 at 5:03 PM, Raul Kripalani <ra...@evosent.com> wrote:
> If you use the logging API directly (e.g. slf4j) from within a Processor,
> it should. But that's not the Camel way of doing things ;-)
>
> *Raúl Kripalani*
> Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
> Integration specialist
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk
>
> On Fri, Aug 30, 2013 at 3:58 PM, Hilderich <hi...@yahoo.de> wrote:
>
>> Hello Raul,
>>
>> as you can see below I am using the bundle name as the sifting key:
>>
>> As you have mentioned I have no hope that plain logging inside the route
>> can
>> appear in
>> the proper bundle log file, isn't it?
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Logging-into-the-bundle-log-file-via-to-log-tp5738205p5738319.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>



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

Re: Logging into the bundle log file via to("log:...")

Posted by Grzegorz Grzybek <gr...@gmail.com>.
Hello

I did some investigation and I think it's almost impossible to properly set
the bundle in org.ops4j.pax.logging.slf4j.Slf4jLogger which is used by
CamelLogger.

The problem is described  here
<https://issues.apache.org/jira/browse/CAMEL-6694?focusedCommentId=13955364&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13955364> 
. org.ops4j.pax.logging.internal.BundleHelper always finds the camel-core
bundle as the one which requests creating Logger.

So either we introduce a way of configuring
org.ops4j.pax.logging.internal.BundleHelper (by setting a filter or number
of traces in stacktrace) or we could just use user provided (in message
headers) Logger instance and use it in
org.apache.camel.processor.CamelLogProcessor.process(**) methods.

We could use org.apache.camel.util.CamelLogger.log() methods which take
Logger parameter (if appropriate object is found in headers.

What do you think?
regards
Grzegorz Grzybek



--
View this message in context: http://camel.465427.n5.nabble.com/Logging-into-the-bundle-log-file-via-to-log-tp5738205p5749575.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Logging into the bundle log file via to("log:...")

Posted by Raul Kripalani <ra...@evosent.com>.
Great idea. I logged a ticket:
https://issues.apache.org/jira/browse/CAMEL-6694.

Regards,

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

On Sun, Sep 1, 2013 at 9:39 AM, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> Yeah wonder if we could improve this in Camel, so .to("log:xxx") and
> .log("foo") uses a logger created by the application bundle.
>
> So if we let the application bundles classloader try to load the
> logger as a class, and use that? Well we could try to experiment. Then
> by default it still runs normally for end users, but for ppl using
> that shift appender then the pax-logger framework may be able to
> figure out the logger class is from the application bundle, and not
> from camel-core bundle.
>
>
>
>
>
> On Fri, Aug 30, 2013 at 5:03 PM, Raul Kripalani <ra...@evosent.com> wrote:
> > If you use the logging API directly (e.g. slf4j) from within a Processor,
> > it should. But that's not the Camel way of doing things ;-)
> >
> > *Raúl Kripalani*
> > Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
> > Integration specialist
> > http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> > http://blog.raulkr.net | twitter: @raulvk
> >
> > On Fri, Aug 30, 2013 at 3:58 PM, Hilderich <hi...@yahoo.de>
> wrote:
> >
> >> Hello Raul,
> >>
> >> as you can see below I am using the bundle name as the sifting key:
> >>
> >> As you have mentioned I have no hope that plain logging inside the route
> >> can
> >> appear in
> >> the proper bundle log file, isn't it?
> >>
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://camel.465427.n5.nabble.com/Logging-into-the-bundle-log-file-via-to-log-tp5738205p5738319.html
> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>