You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Maurer Uwe <u....@enbw.com> on 2008/06/19 16:44:04 UTC

howto configure CXF-Jetty logging

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 SelectChannelConnector@0.0.0.0: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 SelectChannelConnector@0.0.0.0: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


RE: howto configure CXF-Jetty logging

Posted by Pawel Lipka <p....@amg.net.pl>.
Hi,

Sorry i misunderstood your question. 
I did not try it myself but here's a jetty logging tutorial:
http://jetty.mortbay.org/jetty5/tut/logging.html 


--

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: Maurer Uwe [mailto:u.maurer@enbw.com] 
Sent: Friday, June 20, 2008 11:05 AM
To: users@cxf.apache.org
Subject: AW: howto configure CXF-Jetty logging

Hi,

thanks for your answers, but my problem is NOT to configure CXF-logging
itself (this works), it is the underlying embedded jetty server that causes
the mentioned outputs. I didnt' find a way to customize this so far.

Thanks for any hints.

Uwe
> -----Ursprüngliche Nachricht-----
> Von: Sergey Pulyaev [mailto:Sergey.Pulyaev@intego-group.com]
> Gesendet: Freitag, 20. Juni 2008 10:46
> An: users@cxf.apache.org
> Betreff: RE: howto configure CXF-Jetty logging
> 
> 
> Read this manual - how to configure log4J logging instead of 
> java.util.logging. http://cwiki.apache.org/CXF20DOC/debugging.html
> 
> I use log4j now without any problem :-)
> 
> Best regards
> 	Sergey
> 
> 
> -----Original Message-----
> From: Glen Mazza [mailto:glen.mazza@verizon.net]
> Sent: Friday, June 20, 2008 3:58 AM
> To: users@cxf.apache.org
> 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
> SelectChannelConnector@0.0.0.0: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
> SelectChannelConnector@0.0.0.0: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
> > 
> 
> 
> --------
> This data is for general information only and shall not be used to 
> produce documents of any kind without same being submitted to, 
> reviewed by, and approved by Intego in writing.
> All data is subject to change. User assumes all liability relating to 
> the use of this data and agrees to release, indemnify, and hold 
> harmless Intego from any and all claims relating said use. User is 
> responsible to check for any viruses before use.
> 


AW: howto configure CXF-Jetty logging

Posted by Maurer Uwe <u....@enbw.com>.
Hi,

thanks for your answers, but my problem is NOT to configure CXF-logging
itself (this works), it is the underlying embedded jetty server that causes
the mentioned outputs. I didnt' find a way to customize this so far.

Thanks for any hints.

Uwe
> -----Ursprüngliche Nachricht-----
> Von: Sergey Pulyaev [mailto:Sergey.Pulyaev@intego-group.com] 
> Gesendet: Freitag, 20. Juni 2008 10:46
> An: users@cxf.apache.org
> Betreff: RE: howto configure CXF-Jetty logging
> 
> 
> Read this manual - how to configure log4J logging instead of 
> java.util.logging. http://cwiki.apache.org/CXF20DOC/debugging.html
> 
> I use log4j now without any problem :-)
> 
> Best regards
> 	Sergey
> 
> 
> -----Original Message-----
> From: Glen Mazza [mailto:glen.mazza@verizon.net] 
> Sent: Friday, June 20, 2008 3:58 AM
> To: users@cxf.apache.org
> 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
> SelectChannelConnector@0.0.0.0: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
> SelectChannelConnector@0.0.0.0: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
> > 
> 
> 
> --------
> This data is for general information only and shall not be 
> used to produce documents of any kind without same being 
> submitted to, reviewed by, and approved by Intego in writing. 
> All data is subject to change. User assumes all liability 
> relating to the use of this data and agrees to release, 
> indemnify, and hold harmless Intego from any and all claims 
> relating said use. User is responsible to check for any 
> viruses before use. 
> 

RE: howto configure CXF-Jetty logging

Posted by Sergey Pulyaev <Se...@intego-group.com>.
Read this manual - how to configure log4J logging instead of
java.util.logging.
http://cwiki.apache.org/CXF20DOC/debugging.html

I use log4j now without any problem :-)

Best regards
	Sergey


-----Original Message-----
From: Glen Mazza [mailto:glen.mazza@verizon.net] 
Sent: Friday, June 20, 2008 3:58 AM
To: users@cxf.apache.org
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
SelectChannelConnector@0.0.0.0: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
SelectChannelConnector@0.0.0.0: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
> 


--------
This data is for general information only and shall not be used to produce documents of any kind without same being submitted to, reviewed by, and approved by Intego in writing. All data is subject to change. User assumes all liability relating to the use of this data and agrees to release, indemnify, and hold harmless Intego from any and all claims relating said use. User is responsible to check for any viruses before use. 

RE: howto configure CXF-Jetty logging

Posted by Pawel Lipka <p....@amg.net.pl>.
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:glen.mazza@verizon.net] 
Sent: Friday, June 20, 2008 2:58 AM
To: users@cxf.apache.org
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 
> SelectChannelConnector@0.0.0.0: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 
> SelectChannelConnector@0.0.0.0: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
> 


Re: howto configure CXF-Jetty logging

Posted by Glen Mazza <gl...@verizon.net>.
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 SelectChannelConnector@0.0.0.0: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 SelectChannelConnector@0.0.0.0: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
>