You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Matthew O'Connor <th...@gmail.com> on 2010/06/30 01:39:05 UTC

[Distributed OSGi] Using Log4j as the logger in CXF DOSGi?

Hello all, this may be an obvious question, but I can't seem to get the CXF
Distributed OSGi single bundle to use Log4J as the logger instead of
java.util.logging. I've added
"-Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger" to my
run command so I'm getting a

"DEBUG [Start Level Event Dispatcher] (LogUtils.java:82) - Using
org.apache.cxf.common.logging.Log4jLogger for logging."

In my log, which is what I expect.

This is followed by a bunch of

"Jun 29, 2010 5:22:24 PM org.apache.cxf.dosgi.dsw.qos.IntentMap setIntents
INFO: Injected intents:
{addressing=org.apache.cxf.ws.policy.WSPolicyFeature@ff94b1,
logging=org.apache.cxf.feature.LoggingFeature@17b0998,
SOAP=org.apache.cxf.binding.soap.SoapBindingConfiguration@b30913,
SOAP.1_1=org.apache.cxf.binding.soap.SoapBindingConfiguration@b30913,
SOAP.1_2=org.apache.cxf.binding.soap.SoapBindingConfiguration@18f51f,
HTTP=PROVIDED}
Jun 29, 2010 5:22:24 PM
org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService addTracker
INFO: adding tracker:
org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$DiscoveryCallback@13e0abacollection:
null registered against prop:
osgi.remote.discovery.interest.interfaces
Jun 29, 2010 5:22:24 PM
org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService addTracker
INFO: adding tracker:
org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$DiscoveryCallback@13e0abacollection:
null registered against prop:
osgi.remote.discovery.interest.filters
Jun 29, 2010 5:22:24 PM
org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService triggerCallbacks
INFO: nothing to search for matches to trigger callbacks with delta: []"

which seems to say that either the configuration I thought I did didn't work
or there are parts of the CXF DOSGi implementation that don't support
setting org.apache.cxf.Logger, since those log entries are still using the
java.util.logging framework.

Any ideas?

Thanks,
Matthew

Re: [Distributed OSGi] Using Log4j as the logger in CXF DOSGi?

Posted by Matthew O'Connor <th...@gmail.com>.
Thanks, I opened an issue.

I'll take a look at pax-logging, but I'll probably just hold out for a fix
in CXF DOSGi.

Matthew

On Wed, Jun 30, 2010 at 11:00 AM, Daniel Kulp <dk...@apache.org> wrote:

>
> It looks like NONE of the DOSGI stuff is using the CXF LogUtils.... stuff
> for
> obtaining the Logger.   Thus, it doesn't work there.    Can you log a bug?
>
> As another option, you could look at adding the pax-logging stuff to your
> osgi
> container.   It provides all the logging API's (slf4j, log4j, commons
> logging,
> jdk logging, etc...), but they all route into log4j (I think).
>
> Dan
>
>
> On Tuesday 29 June 2010 7:39:05 pm Matthew O'Connor wrote:
> > Hello all, this may be an obvious question, but I can't seem to get the
> CXF
> > Distributed OSGi single bundle to use Log4J as the logger instead of
> > java.util.logging. I've added
> > "-Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger" to my
> > run command so I'm getting a
> >
> > "DEBUG [Start Level Event Dispatcher] (LogUtils.java:82) - Using
> > org.apache.cxf.common.logging.Log4jLogger for logging."
> >
> > In my log, which is what I expect.
> >
> > This is followed by a bunch of
> >
> > "Jun 29, 2010 5:22:24 PM org.apache.cxf.dosgi.dsw.qos.IntentMap
> setIntents
> > INFO: Injected intents:
> > {addressing=org.apache.cxf.ws.policy.WSPolicyFeature@ff94b1,
> > logging=org.apache.cxf.feature.LoggingFeature@17b0998,
> > SOAP=org.apache.cxf.binding.soap.SoapBindingConfiguration@b30913,
> > SOAP.1_1=org.apache.cxf.binding.soap.SoapBindingConfiguration@b30913,
> > SOAP.1_2=org.apache.cxf.binding.soap.SoapBindingConfiguration@18f51f,
> > HTTP=PROVIDED}
> > Jun 29, 2010 5:22:24 PM
> > org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService addTracker
> > INFO: adding tracker:
> >
> org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$DiscoveryCallback@13e0aba
> > collection: null registered against prop:
> > osgi.remote.discovery.interest.interfaces
> > Jun 29, 2010 5:22:24 PM
> > org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService addTracker
> > INFO: adding tracker:
> >
> org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$DiscoveryCallback@13e0aba
> > collection: null registered against prop:
> > osgi.remote.discovery.interest.filters
> > Jun 29, 2010 5:22:24 PM
> > org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService
> triggerCallbacks
> > INFO: nothing to search for matches to trigger callbacks with delta: []"
> >
> > which seems to say that either the configuration I thought I did didn't
> > work or there are parts of the CXF DOSGi implementation that don't
> support
> > setting org.apache.cxf.Logger, since those log entries are still using
> the
> > java.util.logging framework.
> >
> > Any ideas?
> >
> > Thanks,
> > Matthew
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
>

Re: [Distributed OSGi] Using Log4j as the logger in CXF DOSGi?

Posted by Daniel Kulp <dk...@apache.org>.
It looks like NONE of the DOSGI stuff is using the CXF LogUtils.... stuff for 
obtaining the Logger.   Thus, it doesn't work there.    Can you log a bug?

As another option, you could look at adding the pax-logging stuff to your osgi 
container.   It provides all the logging API's (slf4j, log4j, commons logging, 
jdk logging, etc...), but they all route into log4j (I think).

Dan


On Tuesday 29 June 2010 7:39:05 pm Matthew O'Connor wrote:
> Hello all, this may be an obvious question, but I can't seem to get the CXF
> Distributed OSGi single bundle to use Log4J as the logger instead of
> java.util.logging. I've added
> "-Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger" to my
> run command so I'm getting a
> 
> "DEBUG [Start Level Event Dispatcher] (LogUtils.java:82) - Using
> org.apache.cxf.common.logging.Log4jLogger for logging."
> 
> In my log, which is what I expect.
> 
> This is followed by a bunch of
> 
> "Jun 29, 2010 5:22:24 PM org.apache.cxf.dosgi.dsw.qos.IntentMap setIntents
> INFO: Injected intents:
> {addressing=org.apache.cxf.ws.policy.WSPolicyFeature@ff94b1,
> logging=org.apache.cxf.feature.LoggingFeature@17b0998,
> SOAP=org.apache.cxf.binding.soap.SoapBindingConfiguration@b30913,
> SOAP.1_1=org.apache.cxf.binding.soap.SoapBindingConfiguration@b30913,
> SOAP.1_2=org.apache.cxf.binding.soap.SoapBindingConfiguration@18f51f,
> HTTP=PROVIDED}
> Jun 29, 2010 5:22:24 PM
> org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService addTracker
> INFO: adding tracker:
> org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$DiscoveryCallback@13e0aba
> collection: null registered against prop:
> osgi.remote.discovery.interest.interfaces
> Jun 29, 2010 5:22:24 PM
> org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService addTracker
> INFO: adding tracker:
> org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$DiscoveryCallback@13e0aba
> collection: null registered against prop:
> osgi.remote.discovery.interest.filters
> Jun 29, 2010 5:22:24 PM
> org.apache.cxf.dosgi.discovery.local.LocalDiscoveryService triggerCallbacks
> INFO: nothing to search for matches to trigger callbacks with delta: []"
> 
> which seems to say that either the configuration I thought I did didn't
> work or there are parts of the CXF DOSGi implementation that don't support
> setting org.apache.cxf.Logger, since those log entries are still using the
> java.util.logging framework.
> 
> Any ideas?
> 
> Thanks,
> Matthew

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog