Hi,

You can force CXF to use log4j or any other log system by putting the
following file:
        META-INF/cxf/org.apache.cxf.Logger 
on your classpath.

To enable log4j logging the file should contain a single line:
        org.apache.cxf.common.logging.Log4jLogger 

Works like a charm but sometimes generates weired compilation issues (at
least if u r using the code-gen-plugin)


--

Pawel Lipka

IT Architect

________________________________

 AMG.net  businesstechnology consulting 

 http://www.amg.net.pl

Łąkowa 11, 90-554 Lodz, tel/fax (42) 296 11 32

Tresc niniejszej wiadomosci moze byc poufna. Jezeli nie jestescie Panstwo
jej adresatem, to rozprowadzanie  lub wykorzystywanie zawartych tu
informacji jest zabronione.


-----Original Message-----
From: Glen Mazza [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 20, 2008 2:58 AM
To: [email protected]
Subject: Re: howto configure CXF-Jetty logging

Pardon the mushy answer, as I'm not sure, but I believe CXF uses JDK logging
internally, so you can't use Log4J even if you wanted to--that is, if Log4J
doesn't have some ability to capture/trap Java logging, which it might (I
don't know).

HTH,
Glen

2008-06-19 Maurer Uwe wrote:
> How can i accomplish to get the embedded jetty in apache-cxf use the 
> appender-layout defined within my log4j.properties configuration file 
> instead of the default layout?
> I already got cxf to use my log4j configuration by providing the 
> following
> system-property:
> -Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger
> 
> My log4j configuration is as follows:
> log4j.appender.Console=org.apache.log4j.ConsoleAppender
> log4j.appender.Console.layout=org.apache.log4j.PatternLayout
> log4j.appender.Console.layout.ConversionPattern=%d %-5p %c - %m - 
> [%t]%n
> 
> log4j.rootLogger=WARN, Console
> 
> log4j.logger.org.apache.cxf=INFO, Console 
> log4j.logger.org.mortbay=INFO, Console
> 
> The log-output is as follows:
> 2008-06-19 14:06:04,891 INFO  org.apache.cxf.endpoint.ServerImpl - 
> Setting the server's publish address to be XXX - [main]
> 2008-06-19 14:06:04,891 INFO  org.apache.cxf.endpoint.ServerImpl - 
> Setting the server's publish address to be XXX - [main]
> 2008-06-19 14:06:04.953::INFO:  Logging to STDERR via 
> org.mortbay.log.StdErrLog
> 2008-06-19 14:06:04.969::INFO:  jetty-6.1.9
> 2008-06-19 14:06:05.063::INFO:  Started 
> [EMAIL PROTECTED]:9877
> 2008-06-19 14:06:06,512 INFO  com.foo.bar.FooBar - Backend startet
> 1213877160807 - [main]
> 
> The desired log-output would be similar to this:
> 2008-06-19 14:06:04,891 INFO  org.apache.cxf.endpoint.ServerImpl - 
> Setting the server's publish address to be XXX - [main]
> 2008-06-19 14:06:04,891 INFO  org.apache.cxf.endpoint.ServerImpl - 
> Setting the server's publish address to be XXX - [main]
> 2008-06-19 14:06:04,953 INFO  Logging to STDERR via 
> org.mortbay.log.StdErrLog
> 2008-06-19 14:06:04,969 INFO  jetty-6.1.9
> 2008-06-19 14:06:05,063 INFO  Started 
> [EMAIL PROTECTED]:9877
> 2008-06-19 14:06:06,512 INFO  com.foo.bar.FooBar - Backend startet
> 1213877160807 - [main]
> 
> I have already tried the specific jetty system-property to control 
> jetty not to use java util logging, but that didn't do the trick:
> -Dorg.mortbay.log.LogFactory.noDiscovery=false
> 
> Thanks for any help.
> 
> Uwe
> 

Reply via email to