[ https://issues.apache.org/jira/browse/CXF-2597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cyrille Le Clerc updated CXF-2597: ---------------------------------- Attachment: CXF-2597.patch Patch description : * LoggingMessage : ** add responseCode field ** output responseCode field in toString() method only if it is not empty (ie server side outbound message or client side inbound message) ** output payload field in toString() method only if it is not empty because it is common in REST to have empty payloads * LoggingInInterceptor and LoggingOutInterceptor : fill LoggingMessage.responseCode field if the response code is found on the message > Add response code to LoggingFeature for REST/JAX-RS specific response codes > --------------------------------------------------------------------------- > > Key: CXF-2597 > URL: https://issues.apache.org/jira/browse/CXF-2597 > Project: CXF > Issue Type: Improvement > Components: Core > Affects Versions: 2.2.5, 2.3 > Reporter: Cyrille Le Clerc > Assignee: Cyrille Le Clerc > Attachments: CXF-2597.patch > > > As REST services use custom (http) response codes, it is very valuable to > display the response code in the logs outputted by the LoggingFeature (ie > LoggingInInterceptor & LoggingOutInterceptor). > I have a pending question : would it be interesting to add the response > message (e.g. "Not Found") in addition to the response code ? > It would require to add it to the Message attributes in the HttpConduit and > to create the associated constant on {{o.a.c.message.Message}}. > {noformat:title=Current log message without the response code} > 2009/12/30 11:08:59,563 INFO [http-8080-3] > org.apache.cxf.interceptor.LoggingInInterceptor - Outbound Message > --------------------------- > ID: 26 > Content-Type: text/html > Headers: {Date=[Wed, 30 Dec 2009 10:08:59 GMT]} > Payload: Hi cyrille > -------------------------------------- > {noformat} > {noformat:title=Enhanced log message with the response code} > 2009/12/30 11:08:59,563 INFO [http-8080-3] > org.apache.cxf.interceptor.LoggingInInterceptor - Outbound Message > --------------------------- > ID: 26 > Response-Code: 200 > Content-Type: text/html > Headers: {Date=[Wed, 30 Dec 2009 10:08:59 GMT]} > Payload: Hi cyrille > -------------------------------------- > {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.