Hi Sven
On 14/02/12 16:40, Viehmeier, Sven wrote:
Hi Sergey,
Thanks for your reply. I had a look at the links. If I understand the function
of the different bundles correct, you ran a zookeeper instance in your OSGi
container using the cxf-dosgi-ri-discovery-distributed-zookeeper-server bundle
and configured it using
cxf-dosgi-ri-discovery-distributed-zookeeper-server-config. The difference to
my case is that I need to use an independent zookeeper instance running in a
separate virtual machine. CXF seems to find the zookeeper instance since I see
some log output with the zookeeper IP and I also see log outputs telling me
about the endpoint URL of the service that I want to communicate with. The
problem is that my ServiceTracker still does not recognize the service.
I run a zookeeper instance in a separate JVM, but I did set a -D system
property when starting a Felix instance to make sure no random port is
picked up. The guide at
http://cxf.apache.org/dosgi-discovery.html
is out of date so after observing the discovery demo not working as
expected I installed those 2 extra bundles, set the system property and
it started working... To be honest I'm not even sure those two bundles
made a difference :-), all I was concerned about was to make sure the
existing demo was still working, the distributed discovery was of the
least concern for 1.3, rather it was to solve various minor but blocking
issues and kick start the process again... Nothing changed with respect
to the distributed discovery except that the legacy zookeeper wrapper
bundle was removed.
Please try the discovery demo - and if you can't make it work then I'll
try to reproduce the way I did it.
Concerning the logs that I get. Do you think they come from the container itself? Because
there are many logs on the console starting with " org.apache.cxf". I would
have guessed that they come from one of the CXF bundles and that CXF is using a certain
logging framework like log4j. Do you perhaps know which framework is used for CXF so I
can first try to configure CXF and then see where the other logs come from?
CXF should be able to work with different logging frameworks, please see
this section:
http://cxf.apache.org/docs/debugging-and-logging.html#DebuggingandLogging-LoggingMessages
Cheers, Sergey
Cheers,
Sven
-----Original Message-----
From: Sergey Beryozkin [mailto:[email protected]]
Sent: 14 February 2012 15:45
To: [email protected]
Subject: Re: Configure logging in CXF + pax-web + Jetty
Hi,
On 14/02/12 13:02, Viehmeier, Sven wrote:
Hello,
I already mentioned it in a previous mail, but decided to make a new one since
it seems to be a bigger issue.
At the moment, I try to run CXF with the pax-web bundle to be able to configure
the Jetty server provided by pax-web. This combination is working with CXF 1.2
single bundle distribution, but all the bundles log such a huge amount of
information on the console that it slows down my application. Therefore, I
tried to disable logging for both bundles, but I did not have success yet. Here
is what I tried so far:
- Create fragment bundles with a log4j.properties and attach them to
CXF and pax-web; had no effect
- Configure the log level using system properties like
-Dorg.ops4j.pax.logging.DefaultServiceLog.level; had no effect
- Add pax-logging to my container; Problems here:
o the single bundle versions of CXF have logging frameworks included so I
cannot use them
o CXF version 1.2 multibundle needs the package org.apache.log4j.jmx which is
not exported by pax-logging
o CXF version 1.3 multibundle does not need this package, but I did not get
it to work with my zookeeper (my services are not found anymore)
I did manage to run a discovery sample just before doing the release,
I got the following bundles added:
http://svn.apache.org/viewvc/cxf/dosgi/tags/cxf-dosgi-ri-1.3/distribution/multi-bundle/src/main/resources/distro_discovery_bundles.xml?view=markup
and I think I had to set a system property as shown in
http://svn.apache.org/viewvc/cxf/dosgi/tags/cxf-dosgi-ri-1.3/discovery/distributed/zookeeper-server-config/src/main/java/org/apache/cxf/dosgi/discovery/zookeeper/server/config/Activator.java?revision=1239591&view=markup
though I guess one can set it up from the shell...
I think there is at least one way to configure the logging in each of these
frameworks (CXF, pax-web, Jetty). Pax-logging should be the most generic
solution so I can tell you more about my problems with it if there is no easier
way to configure the logging. Does anybody have some more hints what I could
try?
Here are some examples of the log messages that I want to get rid of:
Feb 14, 2012 12:48:15 PM
org.apache.cxf.dosgi.discovery.zookeeper.InterfaceDataMonitorListenerImpl
processChild
INFO: Child: /osgi/service_registry/...
****************
notifyListeners({endpoint.framework.uuid=80ddda84-0357-0011-1dd6-a9aea21915ce,
endpoint.id=...}, false)
[Start Level Event Dispatcher] INFO
org.ops4j.pax.web.service.internal.Activator - Pax Web started
[Framework Event Dispatcher] DEBUG org.ops4j.pax.web.pax-web-jetty-bundle -
BundleEvent STARTED
Sorry, no idea :-). If I were to find the solution, then I'd probably
get the Karaf source and see how the logging gets centralized there, as
it appears to be a container-level issue, how to make sure the Log
manager intercepting all the log requests is installed and set up...
Cheers, Sergey
Thanks in advance,
Sven
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com