cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CXF-7254) New LoggingFeature Sl4jEventSender does not log the request headers
Date Tue, 28 Feb 2017 12:19:45 GMT

    [ https://issues.apache.org/jira/browse/CXF-7254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15887889#comment-15887889
] 

Sergey Beryozkin edited comment on CXF-7254 at 2/28/17 12:19 PM:
-----------------------------------------------------------------

Hi Dan, Christian

I reverted my recent update to the event formatter which was starting the output from the
next line as it indeed looked a bit strange, even though well aligned but I also removed a
"Type:" prefix to make it arguably a bit more optimal.

Slf4jEventSender:
{noformat}
Feb 28, 2017 11:40:41 AM org.apache.cxf.ext.logging.slf4j.Slf4jEventSender send
INFO: RESP_OUT
    Content-Type: application/x-www-form-urlencoded
    ResponseCode: 200
    ExchangeId: 2b7d6436-8608-4309-9cf8-9d872ec445e5
    MessageId: 555ff248-64f7-4442-99fc-22e0ce4a208f
    Headers: {BookId=123, MAP-NAME=javax.ws.rs.core.MultivaluedMap, Date=Tue, 28 Feb 2017
11:40:41 GMT, Content-Type=application/x-www-form-urlencoded}
    Payload: a=aValue&b=b+value&c%25=cValue
{noformat} 

and PrintWriterEventSender:
{noformat}
2017-02-28T11:40:41.321Z - PrintWriterEventSender - REQ_IN
    Address: http://localhost:9001/bookstore/form
    HttpMethod: POST
    Content-Type: application/x-www-form-urlencoded
    ExchangeId: 2b7d6436-8608-4309-9cf8-9d872ec445e5
    MessageId: 76f84634-c18c-4f68-8bd5-4c56381f46ac
    Headers: {Accept=*/*, Cache-Control=no-cache, User-Agent=Apache-CXF/${project.version},
connection=keep-alive, content-type=application/x-www-form-urlencoded, Host=localhost:9001,
Pragma=no-cache, Content-Length=30}
    Payload: a=aValue&b=b+value&c%25=cValue
{noformat} 

It feels quite optimal to me now as REQ_IN/REQ_OUT is self descriptive and fits well on the
same line with INFO/etc, but feel free to add a "Type:" back if you like.

I'd also like to get rid of 'MessageId' from the (verbose) output, but we can still keep it
as MDC property. MessageId is redundant - it is local to a given in/out part of the exchange
and thus can't be used to correlate, it just adds to the space. Besides ExhangeID plus REQ_IN
or ExhangeID +  plus REC_OUT pairs can be used to correlate on the given in or out flow if
really needed.

Thanks, Sergey 


was (Author: sergey_beryozkin):
Hi Dan, Christian

I reverted my recent update to the event formatter which was starting the output from the
next line as it indeed looked a bit strange, even though well aligned but I also removed a
"Type:" prefix to make it arguably a bit more optimal.

Slf4jEventSender:
{noformat}
Feb 28, 2017 11:40:41 AM org.apache.cxf.ext.logging.slf4j.Slf4jEventSender send
INFO: RESP_OUT
    Content-Type: application/x-www-form-urlencoded
    ResponseCode: 200
    ExchangeId: 2b7d6436-8608-4309-9cf8-9d872ec445e5
    MessageId: 555ff248-64f7-4442-99fc-22e0ce4a208f
    Headers: {BookId=123, MAP-NAME=javax.ws.rs.core.MultivaluedMap, Date=Tue, 28 Feb 2017
11:40:41 GMT, Content-Type=application/x-www-form-urlencoded}
    Payload: a=aValue&b=b+value&c%25=cValue
{noformat} 

and PrintWriterEventSender:
{noformat}
2017-02-28T11:40:41.321Z - PrintWriterEventSender - REQ_IN
    Address: http://localhost:9001/bookstore/form
    HttpMethod: POST
    Content-Type: application/x-www-form-urlencoded
    ExchangeId: 2b7d6436-8608-4309-9cf8-9d872ec445e5
    MessageId: 76f84634-c18c-4f68-8bd5-4c56381f46ac
    Headers: {Accept=*/*, Cache-Control=no-cache, User-Agent=Apache-CXF/${project.version},
connection=keep-alive, content-type=application/x-www-form-urlencoded, Host=localhost:9001,
Pragma=no-cache, Content-Length=30}
    Payload: a=aValue&b=b+value&c%25=cValue
{noformat} 

It feels quite optimal to me now as REQ_IN/REQ_OUT is self descriptive and fits well on the
same line with INFO/etc, but feel free to add a "Type:" back if you like.

I'd also like to get rid of 'MessageId' from the (verbose) output, but we can still keep it
as MDC property. MessageId is redundant - it is local to a given in/out part of the exchange
and thus can't be used to correlate, it just adds to the space. Besides ExhangeID plus REQ_IN
or ExhangeID +  plus REC_OUT pairs can be used to correlate om the given in or out flow if
really needed.

Thanks, Sergey 

> New LoggingFeature Sl4jEventSender does not log the request headers
> -------------------------------------------------------------------
>
>                 Key: CXF-7254
>                 URL: https://issues.apache.org/jira/browse/CXF-7254
>             Project: CXF
>          Issue Type: Bug
>          Components: logging
>            Reporter: Sergey Beryozkin
>            Assignee: Christian Schneider
>             Fix For: 3.2.0, 3.1.11
>
>
> No request/response properties are reported which, in case of the requests with the empty
payloads, leads to no info reported at all, while for the requests with the payloads only
the payload INFO is displayed



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message