cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Re: DOSGI LoggingInInterceptor remains silent?
Date Fri, 04 Nov 2016 10:48:36 GMT
In CXF-DOSGi 2 there is no property for setting interceptors. Currently 
the only way is to use intents.

See:
https://github.com/apache/cxf-dosgi/tree/master/common

Here is an example for an intent:
https://github.com/apache/cxf-dosgi/blob/master/samples/ssl/ssl-intent/src/main/java/org/apache/cxf/dosgi/samples/ssl/SslIntent.java

The idea is to simply export an OSGi service with the LoggingFeature and 
setting a property org.apache.cxf.dosgi.IntentName=logging.

You can then use the property service.exported.intents=logging on your 
remote service. CXF DOSGi will wait till all named intents are present 
and then add them to your service
before publishing it.

I am currently working on a change to the new logging support to 
automatically export an intent service named logging. Then you can 
simply add the property to your service and do not have to publish the 
intent yourself.
See https://issues.apache.org/jira/browse/CXF-7125
I will shortly commit the code so you can see how it works.

Currently this is not very well documented so let me know if you run 
into problems.

Btw. We also would like to get feedback if the intent approach is good 
or if you would prefer something else.
The reason for the intent approach is that it does not have any 
classloading issues and it allows to configure the intent using e.g. 
config admin. Another important
point is that the intent name is also stored in discovery. So an 
automatically created client will also get the intent applied.
We are aware that it is a more effort to setup though. So I would like 
to hear what your experiences are with it in practice.

Christian


Btw. For now there is also a nice workaround for logging. See Auto 
logging in the link below:
http://cxf.apache.org/docs/message-logging.html
Activating it will install logging to all CXF endpoints and clients 
including the DOSGi ones. Be aware though that the logging feature must 
start before your service to make it work.


On 04.11.2016 11:24, nino martinez wael wrote:
> cxf-dosgi-2.0.0
>
> On Fri, Nov 4, 2016 at 11:21 AM, Christian Schneider <
> chris@die-schneider.net> wrote:
>
>> Which DOSGi version do you use?
>>
>> Christian
>>
>> On 04.11.2016 11:11, nino martinez wael wrote:
>>
>>> Hi
>>>
>>> I cannot get a request logger working I've tried this:
>>>
>>> "org.apache.cxf.rs.in.interceptors=org.apache.cxf.intercepto
>>> r.LoggingInInterceptor"
>>>
>>> But log remains silent, im using a plain karaf.. Do loglevels need to set
>>> anything specific?
>>>
>>>
>> --
>> Christian Schneider
>> http://www.liquid-reality.de
>>
>> Open Source Architect
>> http://www.talend.com
>>
>>
>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Mime
View raw message