cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1069318 - in /cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor: LoggingInInterceptor.java LoggingMessage.java LoggingOutInterceptor.java
Date Thu, 10 Feb 2011 10:05:41 GMT
Author: ningjiang
Date: Thu Feb 10 10:05:41 2011
New Revision: 1069318

URL: http://svn.apache.org/viewvc?rev=1069318&view=rev
Log:
CXF-3325 Logging interceptors should show the HTTP method

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java?rev=1069318&r1=1069317&r2=1069318&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java Thu
Feb 10 10:05:41 2011
@@ -94,6 +94,10 @@ public class LoggingInInterceptor extend
         if (encoding != null) {
             buffer.getEncoding().append(encoding);
         }
+        String httpMethod = (String)message.get(Message.HTTP_REQUEST_METHOD);
+        if (httpMethod != null) {
+            buffer.getHttpMethod().append(httpMethod);
+        }
         String ct = (String)message.get(Message.CONTENT_TYPE);
         if (ct != null) {
             buffer.getContentType().append(ct);

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java?rev=1069318&r1=1069317&r2=1069318&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java Thu Feb
10 10:05:41 2011
@@ -28,6 +28,7 @@ public final class LoggingMessage {
     private final StringBuilder address;
     private final StringBuilder contentType;
     private final StringBuilder encoding;
+    private final StringBuilder httpMethod;
     private final StringBuilder header;
     private final StringBuilder message;
     private final StringBuilder payload;
@@ -42,6 +43,7 @@ public final class LoggingMessage {
         contentType = new StringBuilder();
         address = new StringBuilder();
         encoding = new StringBuilder();
+        httpMethod = new StringBuilder();
         header = new StringBuilder();
         message = new StringBuilder();
         payload = new StringBuilder();
@@ -64,6 +66,10 @@ public final class LoggingMessage {
     public StringBuilder getHeader() {
         return header;
     }
+    
+    public StringBuilder getHttpMethod() {
+        return httpMethod;
+    }
 
     public StringBuilder getContentType() {
         return contentType;
@@ -97,6 +103,10 @@ public final class LoggingMessage {
             buffer.append("\nEncoding: ");
             buffer.append(encoding);
         }
+        if (httpMethod.length() > 0) {
+            buffer.append("\nHttp-Method: ");
+            buffer.append(httpMethod);
+        }
         buffer.append("\nContent-Type: ");
         buffer.append(contentType);
         buffer.append("\nHeaders: ");

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java?rev=1069318&r1=1069317&r2=1069318&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
Thu Feb 10 10:05:41 2011
@@ -106,7 +106,10 @@ public class LoggingOutInterceptor exten
             if (encoding != null) {
                 buffer.getEncoding().append(encoding);
             }            
-            
+            String httpMethod = (String)message.get(Message.HTTP_REQUEST_METHOD);
+            if (httpMethod != null) {
+                buffer.getHttpMethod().append(httpMethod);
+            }
             String address = (String)message.get(Message.ENDPOINT_ADDRESS);
             if (address != null) {
                 buffer.getAddress().append(address);



Mime
View raw message