You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergey Maslov <th...@gmail.com> on 2015/12/04 07:37:35 UTC

Re: Log incoming message with the corresponding response

Guys, Christian,
Could I set LoggingFeature for logging application requests acting as a web
service client?
I looks like, it is for endpoints only.
What could I use for ws client logging to log request and response (with
the similar functionality as LoggingFeature)?

Sergey Maslov

On Mon, Nov 30, 2015 at 2:42 PM, Sergey Maslov <th...@gmail.com>
wrote:

> Christian,
> thank you!
> It looks like it's just what I need!
>
> Best regards,
> Sergey Maslov
>
> On Mon, Nov 30, 2015 at 2:21 PM, Christian Schneider <
> chris@die-schneider.net> wrote:
>
>> You should be able to do the custom logging / filtering with the new
>> LoggingFeature.
>>
>> See:
>>
>> https://github.com/apache/cxf/blob/master/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingFeature.java
>>
>> https://github.com/apache/cxf/blob/master/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/LogEventSender.java
>>
>> You just need to implement the LogEventSender interface and set your
>> implementation in the LoggingFeature. Alternatively you can of course extend
>> LoggingFeature and set you implementation internally.
>>
>> This is the default impl that logs to slf4j:
>>
>> https://github.com/apache/cxf/blob/master/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/slf4j/Slf4jEventSender.java
>>
>> So as you see it is really easy to implement.
>>
>> Christian
>>
>>
>> Am 30.11.2015 um 06:59 schrieb Sergey Maslov:
>>
>>> Andrey, Christian,
>>> thank you.
>>> That would help me much except just one thing:
>>> I need to log requests and responses to the project MongoDB along with
>>> the
>>> simple log file.
>>> So we have special package dealing with logging to MongoDB (separate job
>>> and threads), containing some additional information and message
>>> trasnformations. This is caused by async interaction with some services.
>>> So
>>> we can exchange multiple messages to track business process request
>>> status,
>>> but we need to put to MongoDB the final response only.
>>> With the Apache's built-in fiunctionality, we will need some other
>>> mechanism to move logs into MongoDB. It looks like, we'll need some text
>>> file log search and parsing process, capable to save log to external
>>> storage (like MongoDB).
>>> I have no experience here.
>>> Cound we extend some CXF's logging classes to get the messag content on
>>> the
>>> java code to fufil our business logging requirements?
>>> Or is it better to write custom logger?
>>> Thank you in advance.
>>>
>>> Sergey Maslov
>>>
>>> On Mon, Nov 30, 2015 at 1:51 AM, Christian Schneider <
>>> chris@die-schneider.net> wrote:
>>>
>>> Hi Sergey,
>>>>
>>>> CXF has a new logging feature since 3.1 now.
>>>>
>>>> It provides a message id as well as an exchange id out of the box. It
>>>> even
>>>> sends the message id over the wire so you can also correlate a sent and
>>>> received message.
>>>> Unfortunately I did not yet  update the CXF documentation. I will do
>>>> this
>>>> asap.
>>>>
>>>> For now you can see:
>>>>
>>>>
>>>> http://liquid-reality.de/display/liquid/2015/06/08/Enterprise+ready+request+logging+with+CXF+3.1.0+and+elastic+search
>>>>
>>>> The new logging feature by default logs using slf4j but it provides a
>>>> very
>>>> simple SPI where you can hook in any logging backend you want.
>>>>
>>>> Christian
>>>>
>>>>
>>>> Am 27.11.2015 um 09:07 schrieb Sergey Maslov:
>>>>
>>>> Hi.
>>>>> My application provides SOAP web services using CXF. I need to log
>>>>> incoming
>>>>> request with the corresponding response from my webservice.
>>>>> I've check the interceptor phases for the incoming chain but it looks
>>>>> like
>>>>> I have no information about outgoing message body.
>>>>> Maybe I should use some observer (like message observer for the
>>>>> outgoing
>>>>> message)?
>>>>> Could you help me?
>>>>>
>>>>>
>>>>>
>>>
>>
>
>
> --
> *Sergey Maslov*
>



-- 
*Sergey Maslov*

Re: Log incoming message with the corresponding response

Posted by Sergey Maslov <th...@gmail.com>.
Thank you!
I've cleared up this by myself. I can configure it like the usual feature
in the features section!

Sergey Maslov

On Fri, Dec 4, 2015 at 12:37 PM, Sergey Maslov <th...@gmail.com>
wrote:

> Guys, Christian,
> Could I set LoggingFeature for logging application requests acting as a
> web service client?
> I looks like, it is for endpoints only.
> What could I use for ws client logging to log request and response (with
> the similar functionality as LoggingFeature)?
>
> Sergey Maslov
>
> On Mon, Nov 30, 2015 at 2:42 PM, Sergey Maslov <th...@gmail.com>
> wrote:
>
>> Christian,
>> thank you!
>> It looks like it's just what I need!
>>
>> Best regards,
>> Sergey Maslov
>>
>> On Mon, Nov 30, 2015 at 2:21 PM, Christian Schneider <
>> chris@die-schneider.net> wrote:
>>
>>> You should be able to do the custom logging / filtering with the new
>>> LoggingFeature.
>>>
>>> See:
>>>
>>> https://github.com/apache/cxf/blob/master/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingFeature.java
>>>
>>> https://github.com/apache/cxf/blob/master/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/LogEventSender.java
>>>
>>> You just need to implement the LogEventSender interface and set your
>>> implementation in the LoggingFeature. Alternatively you can of course extend
>>> LoggingFeature and set you implementation internally.
>>>
>>> This is the default impl that logs to slf4j:
>>>
>>> https://github.com/apache/cxf/blob/master/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/slf4j/Slf4jEventSender.java
>>>
>>> So as you see it is really easy to implement.
>>>
>>> Christian
>>>
>>>
>>> Am 30.11.2015 um 06:59 schrieb Sergey Maslov:
>>>
>>>> Andrey, Christian,
>>>> thank you.
>>>> That would help me much except just one thing:
>>>> I need to log requests and responses to the project MongoDB along with
>>>> the
>>>> simple log file.
>>>> So we have special package dealing with logging to MongoDB (separate job
>>>> and threads), containing some additional information and message
>>>> trasnformations. This is caused by async interaction with some
>>>> services. So
>>>> we can exchange multiple messages to track business process request
>>>> status,
>>>> but we need to put to MongoDB the final response only.
>>>> With the Apache's built-in fiunctionality, we will need some other
>>>> mechanism to move logs into MongoDB. It looks like, we'll need some text
>>>> file log search and parsing process, capable to save log to external
>>>> storage (like MongoDB).
>>>> I have no experience here.
>>>> Cound we extend some CXF's logging classes to get the messag content on
>>>> the
>>>> java code to fufil our business logging requirements?
>>>> Or is it better to write custom logger?
>>>> Thank you in advance.
>>>>
>>>> Sergey Maslov
>>>>
>>>> On Mon, Nov 30, 2015 at 1:51 AM, Christian Schneider <
>>>> chris@die-schneider.net> wrote:
>>>>
>>>> Hi Sergey,
>>>>>
>>>>> CXF has a new logging feature since 3.1 now.
>>>>>
>>>>> It provides a message id as well as an exchange id out of the box. It
>>>>> even
>>>>> sends the message id over the wire so you can also correlate a sent and
>>>>> received message.
>>>>> Unfortunately I did not yet  update the CXF documentation. I will do
>>>>> this
>>>>> asap.
>>>>>
>>>>> For now you can see:
>>>>>
>>>>>
>>>>> http://liquid-reality.de/display/liquid/2015/06/08/Enterprise+ready+request+logging+with+CXF+3.1.0+and+elastic+search
>>>>>
>>>>> The new logging feature by default logs using slf4j but it provides a
>>>>> very
>>>>> simple SPI where you can hook in any logging backend you want.
>>>>>
>>>>> Christian
>>>>>
>>>>>
>>>>> Am 27.11.2015 um 09:07 schrieb Sergey Maslov:
>>>>>
>>>>> Hi.
>>>>>> My application provides SOAP web services using CXF. I need to log
>>>>>> incoming
>>>>>> request with the corresponding response from my webservice.
>>>>>> I've check the interceptor phases for the incoming chain but it looks
>>>>>> like
>>>>>> I have no information about outgoing message body.
>>>>>> Maybe I should use some observer (like message observer for the
>>>>>> outgoing
>>>>>> message)?
>>>>>> Could you help me?
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>
>>
>>
>> --
>> *Sergey Maslov*
>>
>
>
>
> --
> *Sergey Maslov*
>



-- 
*Sergey Maslov*