You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Colm O hEigeartaigh <co...@apache.org> on 2018/01/19 10:56:30 UTC

New Logging interceptors

Hi all,

With the old logging interceptors in CXF core (org.apache.cxf.interceptor)
you just had to attach them to the interceptor chain to see the
outbound/inbound requests. These interceptors are now deprecated.

However in the new interceptors (org.apache.cxf.ext.logging), attaching
them to the interceptor chain is not enough to see the requests. You also
need to set the system property org.apache.cxf.logging.enabled to "true".

Is this change in behaviour intended?

Colm.


-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Re: New Logging interceptors

Posted by Colm O hEigeartaigh <co...@apache.org>.
Thanks Christian - I've updated the wiki page to make this point a bit
clearer.

Colm.

On Fri, Jan 19, 2018 at 1:04 PM, Christian Schneider <
chris@die-schneider.net> wrote:

> Instead of the interceptors you should use the new LoggingFeature. It will
> make sure the interceptors are correctly wired.
> If you use it like this then the system property is not required.
>
> See http://cxf.apache.org/docs/message-logging.html
>
> Christian
>
> 2018-01-19 11:56 GMT+01:00 Colm O hEigeartaigh <co...@apache.org>:
>
>> Hi all,
>>
>> With the old logging interceptors in CXF core (org.apache.cxf.interceptor)
>> you just had to attach them to the interceptor chain to see the
>> outbound/inbound requests. These interceptors are now deprecated.
>>
>> However in the new interceptors (org.apache.cxf.ext.logging), attaching
>> them to the interceptor chain is not enough to see the requests. You also
>> need to set the system property org.apache.cxf.logging.enabled to "true".
>>
>> Is this change in behaviour intended?
>>
>> Colm.
>>
>>
>> --
>> Colm O hEigeartaigh
>>
>> Talend Community Coder
>> http://coders.talend.com
>>
>
>
>
> --
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Computer Scientist
> http://www.adobe.com
>
>


-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Re: New Logging interceptors

Posted by Christian Schneider <ch...@die-schneider.net>.
Instead of the interceptors you should use the new LoggingFeature. It will
make sure the interceptors are correctly wired.
If you use it like this then the system property is not required.

See http://cxf.apache.org/docs/message-logging.html

Christian

2018-01-19 11:56 GMT+01:00 Colm O hEigeartaigh <co...@apache.org>:

> Hi all,
>
> With the old logging interceptors in CXF core (org.apache.cxf.interceptor)
> you just had to attach them to the interceptor chain to see the
> outbound/inbound requests. These interceptors are now deprecated.
>
> However in the new interceptors (org.apache.cxf.ext.logging), attaching
> them to the interceptor chain is not enough to see the requests. You also
> need to set the system property org.apache.cxf.logging.enabled to "true".
>
> Is this change in behaviour intended?
>
> Colm.
>
>
> --
> Colm O hEigeartaigh
>
> Talend Community Coder
> http://coders.talend.com
>



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

Computer Scientist
http://www.adobe.com

Re: New Logging interceptors

Posted by Sergey Beryozkin <sb...@gmail.com>.
May be that property was already set somewhere to false, hence reseting 
it to true made a diff, might be worth debugging what 
isLoggingDisabledNow returns...

Sergey
On 19/01/18 11:20, Colm O hEigeartaigh wrote:
> In a test I was working with, message logging only worked when I added the
> new interceptors to the interceptor chain if I explicitly set the system
> property to "true". Otherwise nothing was logged.
> 
> Colm.
> 
> On Fri, Jan 19, 2018 at 11:15 AM, Sergey Beryozkin <sb...@gmail.com>
> wrote:
> 
>> It can only be used to disable the logging if it is explicitly set and is
>> false:
>>
>> https://github.com/apache/cxf/blob/master/rt/features/loggin
>> g/src/main/java/org/apache/cxf/ext/logging/AbstractLoggin
>> gInterceptor.java#L49
>>
>> Sergey
>> On 19/01/18 11:09, Colm O hEigeartaigh wrote:
>>
>>> I don't see "org.apache.cxf.logging.enabled" set anywhere in the systests
>>> or is it enabled a different way?
>>>
>>> Colm.
>>>
>>> On Fri, Jan 19, 2018 at 11:00 AM, Sergey Beryozkin <sb...@gmail.com>
>>> wrote:
>>>
>>> These new interceptors are used in systests, no problems.
>>>> That property is used to switch the logging on/off dynamically...
>>>>
>>>> Cheers, Sergey
>>>>
>>>> On 19/01/18 10:56, Colm O hEigeartaigh wrote:
>>>>
>>>> Hi all,
>>>>>
>>>>> With the old logging interceptors in CXF core
>>>>> (org.apache.cxf.interceptor)
>>>>> you just had to attach them to the interceptor chain to see the
>>>>> outbound/inbound requests. These interceptors are now deprecated.
>>>>>
>>>>> However in the new interceptors (org.apache.cxf.ext.logging), attaching
>>>>> them to the interceptor chain is not enough to see the requests. You
>>>>> also
>>>>> need to set the system property org.apache.cxf.logging.enabled to
>>>>> "true".
>>>>>
>>>>> Is this change in behaviour intended?
>>>>>
>>>>> Colm.
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
> 
> 

Re: New Logging interceptors

Posted by Colm O hEigeartaigh <co...@apache.org>.
In a test I was working with, message logging only worked when I added the
new interceptors to the interceptor chain if I explicitly set the system
property to "true". Otherwise nothing was logged.

Colm.

On Fri, Jan 19, 2018 at 11:15 AM, Sergey Beryozkin <sb...@gmail.com>
wrote:

> It can only be used to disable the logging if it is explicitly set and is
> false:
>
> https://github.com/apache/cxf/blob/master/rt/features/loggin
> g/src/main/java/org/apache/cxf/ext/logging/AbstractLoggin
> gInterceptor.java#L49
>
> Sergey
> On 19/01/18 11:09, Colm O hEigeartaigh wrote:
>
>> I don't see "org.apache.cxf.logging.enabled" set anywhere in the systests
>> or is it enabled a different way?
>>
>> Colm.
>>
>> On Fri, Jan 19, 2018 at 11:00 AM, Sergey Beryozkin <sb...@gmail.com>
>> wrote:
>>
>> These new interceptors are used in systests, no problems.
>>> That property is used to switch the logging on/off dynamically...
>>>
>>> Cheers, Sergey
>>>
>>> On 19/01/18 10:56, Colm O hEigeartaigh wrote:
>>>
>>> Hi all,
>>>>
>>>> With the old logging interceptors in CXF core
>>>> (org.apache.cxf.interceptor)
>>>> you just had to attach them to the interceptor chain to see the
>>>> outbound/inbound requests. These interceptors are now deprecated.
>>>>
>>>> However in the new interceptors (org.apache.cxf.ext.logging), attaching
>>>> them to the interceptor chain is not enough to see the requests. You
>>>> also
>>>> need to set the system property org.apache.cxf.logging.enabled to
>>>> "true".
>>>>
>>>> Is this change in behaviour intended?
>>>>
>>>> Colm.
>>>>
>>>>
>>>>
>>>>
>>
>>


-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Re: New Logging interceptors

Posted by Sergey Beryozkin <sb...@gmail.com>.
It can only be used to disable the logging if it is explicitly set and 
is false:

https://github.com/apache/cxf/blob/master/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/AbstractLoggingInterceptor.java#L49

Sergey
On 19/01/18 11:09, Colm O hEigeartaigh wrote:
> I don't see "org.apache.cxf.logging.enabled" set anywhere in the systests
> or is it enabled a different way?
> 
> Colm.
> 
> On Fri, Jan 19, 2018 at 11:00 AM, Sergey Beryozkin <sb...@gmail.com>
> wrote:
> 
>> These new interceptors are used in systests, no problems.
>> That property is used to switch the logging on/off dynamically...
>>
>> Cheers, Sergey
>>
>> On 19/01/18 10:56, Colm O hEigeartaigh wrote:
>>
>>> Hi all,
>>>
>>> With the old logging interceptors in CXF core (org.apache.cxf.interceptor)
>>> you just had to attach them to the interceptor chain to see the
>>> outbound/inbound requests. These interceptors are now deprecated.
>>>
>>> However in the new interceptors (org.apache.cxf.ext.logging), attaching
>>> them to the interceptor chain is not enough to see the requests. You also
>>> need to set the system property org.apache.cxf.logging.enabled to "true".
>>>
>>> Is this change in behaviour intended?
>>>
>>> Colm.
>>>
>>>
>>>
> 
> 

Re: New Logging interceptors

Posted by Colm O hEigeartaigh <co...@apache.org>.
I don't see "org.apache.cxf.logging.enabled" set anywhere in the systests
or is it enabled a different way?

Colm.

On Fri, Jan 19, 2018 at 11:00 AM, Sergey Beryozkin <sb...@gmail.com>
wrote:

> These new interceptors are used in systests, no problems.
> That property is used to switch the logging on/off dynamically...
>
> Cheers, Sergey
>
> On 19/01/18 10:56, Colm O hEigeartaigh wrote:
>
>> Hi all,
>>
>> With the old logging interceptors in CXF core (org.apache.cxf.interceptor)
>> you just had to attach them to the interceptor chain to see the
>> outbound/inbound requests. These interceptors are now deprecated.
>>
>> However in the new interceptors (org.apache.cxf.ext.logging), attaching
>> them to the interceptor chain is not enough to see the requests. You also
>> need to set the system property org.apache.cxf.logging.enabled to "true".
>>
>> Is this change in behaviour intended?
>>
>> Colm.
>>
>>
>>


-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Re: New Logging interceptors

Posted by Sergey Beryozkin <sb...@gmail.com>.
These new interceptors are used in systests, no problems.
That property is used to switch the logging on/off dynamically...

Cheers, Sergey
On 19/01/18 10:56, Colm O hEigeartaigh wrote:
> Hi all,
> 
> With the old logging interceptors in CXF core (org.apache.cxf.interceptor)
> you just had to attach them to the interceptor chain to see the
> outbound/inbound requests. These interceptors are now deprecated.
> 
> However in the new interceptors (org.apache.cxf.ext.logging), attaching
> them to the interceptor chain is not enough to see the requests. You also
> need to set the system property org.apache.cxf.logging.enabled to "true".
> 
> Is this change in behaviour intended?
> 
> Colm.
> 
>