You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ni...@apache.org on 2010/08/05 10:04:16 UTC

svn commit: r982494 - in /cxf/branches/2.2.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java

Author: ningjiang
Date: Thu Aug  5 08:04:15 2010
New Revision: 982494

URL: http://svn.apache.org/viewvc?rev=982494&view=rev
Log:
Merged revisions 982491 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r982491 | ningjiang | 2010-08-05 15:42:57 +0800 (Thu, 05 Aug 2010) | 1 line
  
  CXF-2931 Add configurable pretty printing to the CXF logging in/out interceptors
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug  5 08:04:15 2010
@@ -1 +1 @@
-/cxf/trunk:980898-980941,981508,981804,982153,982413
+/cxf/trunk:980898-980941,981508,981804,982153,982413,982491

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java?rev=982494&r1=982493&r2=982494&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java Thu Aug  5 08:04:15 2010
@@ -18,14 +18,12 @@
  */
 package org.apache.cxf.interceptor;
 
-import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintWriter;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.io.CachedOutputStream;
 import org.apache.cxf.message.Message;
@@ -151,14 +149,10 @@ public class LoggingInInterceptor extend
                 if (bos.size() > limit) {
                     buffer.getMessage().append("(message truncated to " + limit + " bytes)\n");
                 }
-                if (StringUtils.isEmpty(encoding)) {
-                    bos.writeCacheTo(buffer.getPayload(), limit);
-                } else {
-                    bos.writeCacheTo(buffer.getPayload(), encoding, limit);
-                }
+                writePayload(buffer.getPayload(), bos, encoding); 
                     
                 bos.close();
-            } catch (IOException e) {
+            } catch (Exception e) {
                 throw new Fault(e);
             }
         }

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java?rev=982494&r1=982493&r2=982494&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java Thu Aug  5 08:04:15 2010
@@ -25,7 +25,6 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.io.CacheAndWriteOutputStream;
 import org.apache.cxf.io.CachedOutputStream;
 import org.apache.cxf.io.CachedOutputStreamCallback;
@@ -160,11 +159,7 @@ public class LoggingOutInterceptor exten
                 }
             }
             try {
-                if (StringUtils.isEmpty(encoding)) {
-                    cos.writeCacheTo(buffer.getPayload(), limit);
-                } else {                    
-                    cos.writeCacheTo(buffer.getPayload(), encoding, limit);
-                }
+                writePayload(buffer.getPayload(), cos, encoding); 
             } catch (Exception ex) {
                 //ignore
             }