Actually, it looks like the LOG4J stuff isn't being picked up for CXF. It
looks like the slf4j stuff is finding it (spring, camel, jetty), but CXF
isn't. Double check the contents of the logger file (and no trailing spaces
and such). A quick debug into the static init of our LogUtils class would
help determine what it's picking up.
You could also try the CXF 2.2.7-SNAPSHOT and see if that helps. With 2.2.7,
it's supposed to try and determine if SLF4J is using Log4j and also use Log4j
if it is.
Dan
On Wed February 24 2010 4:13:07 pm Alexandros Karypidis
wrote:
> Hello,
>
> I'm trying to configure CXF to use log4j. I've created
> META-INF/cxf/org.apache.cxf.logger and added a log4j.properties. Indeed
> CXF uses log4j for almost everything except a cases. Specifically, the
> methods that seem to ignore this configuration are:
>
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean:
> buildServiceFromWSDL()
> org.apache.cxf.endpoint.ServerImpl: initDestination()
> org.apache.cxf.transport.servlet.CXFServlet: updateContext()
> org.apache.cxf.transport.servlet.AbstractCXFServlet:
> replaceDestinationFactory()
>
> What could be causing this behavior?
>
> Here's a log excerpt:
>
> =================> Log4j being used
> 0 [main] INFO org.mortbay.log - Logging to
> org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via
> org.mortbay.log.Slf4jLog
> 141 [main] INFO org.mortbay.log - jetty-6.1.22
> ...
> 15394 [Timer-0] INFO org.mortbay.log - No Transaction manager found - if
> your webapp requires one, please configure one.
> 15658 [Timer-0] INFO /my-jetty-cxf-app - Initializing Spring root
> WebApplicationContext
> 15658 [Timer-0] INFO org.springframework.web.context.ContextLoader -
> Root WebApplicationContext: initialization started
> ...
> 17341 [Timer-0] INFO org.apache.camel.impl.DefaultCamelContext - JMX
> enabled. Using DefaultManagedLifecycleStrategy.
> =================> Sudden JCL log message (!)
> 24 Φεβ 2010 10:56:55 μμ
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> buildServiceFromWSDL
> INFO: Creating Service {http://example.com/service/}mysvc from WSDL:
> mysvc.wsdl
> 24 Φεβ 2010 10:56:55 μμ org.apache.cxf.endpoint.ServerImpl initDestination
> INFO: Setting the server's publish address to be /mysvc
> =================> Log4j again
> 18718 [Timer-0] INFO org.apache.camel.impl.DefaultCamelContext - Started
> 1 routes
> 18718 [Timer-0] INFO org.apache.camel.impl.DefaultCamelContext - Apache
> Camel 2.2.0 (CamelContext:octopusCamelContext) started
> 18721 [Timer-0] INFO org.springframework.web.context.ContextLoader -
> Root WebApplicationContext: initialization completed in 3063 ms
> =================> Sudden JCL log messages (!)
> 24 Φεβ 2010 10:56:55 μμ org.apache.cxf.transport.servlet.CXFServlet
> updateContext
> INFO: Load the bus with application context
> =================> Log4j again
> 18761 [Timer-0] INFO org.apache.cxf.bus.spring.BusApplicationContext -
> Refreshing org.apache.cxf.bus.spring.busapplicationcont...@10e0eb5:
> display name [org.apache.cxf.bus.spring.busapplicationcont...@10e0eb5];
> startup date [Wed Feb 24 22:56:55 EET 2010]; parent:
> org.springframework.web.context.support.xmlwebapplicationcont...@1e808ca
> 18774 [Timer-0] INFO org.apache.cxf.bus.spring.BusApplicationContext -
> Bean factory for application context
> [org.apache.cxf.bus.spring.busapplicationcont...@10e0eb5]:
> org.springframework.beans.factory.support.defaultlistablebeanfact...@11a700
> a 18774 [Timer-0] INFO
> org.springframework.beans.factory.support.DefaultListableBeanFactory -
> Pre-instantiating singletons in
> org.springframework.beans.factory.support.defaultlistablebeanfact...@11a700
> a: defining beans []; parent:
> org.springframework.beans.factory.support.defaultlistablebeanfact...@1a4181
> c =================> Sudden JCL log messages (!)
> 24 Φεβ 2010 10:56:55 μμ
> org.apache.cxf.transport.servlet.AbstractCXFServlet
> replaceDestinationFactory
> INFO: Servlet transport factory already registered
--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog