You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Barrie Treloar <ba...@gmail.com> on 2009/09/25 09:15:11 UTC

Access to Loggers

I'm tinkering with service-jms and wonder how to get access to the Loggers.

If I have a JmsConsumerMarshaler then createExchange() is given a
ComponentContext so you can call ComponentContext.getLogger().

However JmsProviderMarshaler has no equivalent and neither
MessageExchange nor NormalizedMessage have a ComponentContext either.
Is this just a deficiency of the interface?

This will tend to infect the signatures of any helper classes if
access to loggers requires ComponentContext.

Suggestions?

Re: Access to Loggers

Posted by Barrie Treloar <ba...@gmail.com>.
On Fri, Sep 25, 2009 at 4:50 PM, Lars Heinemann <lh...@apache.org> wrote:
> Barrie,
>
> just instantiate your own logger instance....
>
> private static final transient Log LOG = LogFactory.getLog(YourClass.class);
>
> That will do it for logging.

Ahh silly, I assumed I needed to use the logging infrastructure provided.

Thanks

Re: Access to Loggers

Posted by Lars Heinemann <lh...@apache.org>.
Barrie,

just instantiate your own logger instance....

private static final transient Log LOG = LogFactory.getLog(YourClass.class);

That will do it for logging.

Lars



2009/9/25 Barrie Treloar <ba...@gmail.com>:
> I'm tinkering with service-jms and wonder how to get access to the Loggers.
>
> If I have a JmsConsumerMarshaler then createExchange() is given a
> ComponentContext so you can call ComponentContext.getLogger().
>
> However JmsProviderMarshaler has no equivalent and neither
> MessageExchange nor NormalizedMessage have a ComponentContext either.
> Is this just a deficiency of the interface?
>
> This will tend to infect the signatures of any helper classes if
> access to loggers requires ComponentContext.
>
> Suggestions?
>



-- 
http://lhein.blogspot.com