View Javadoc

1   /*
2    * $Id: PrettyLoggingInInterceptor.java 19191 2010-08-25 21:05:23Z tcarlson $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.module.cxf.feature;
12  
13  import java.io.PrintWriter;
14  
15  import org.apache.cxf.interceptor.LoggingInInterceptor;
16  
17  /**
18   * Takes the log output from the standard CXF LoggingInterceptor, 
19   * disassembles it, pretty-prints the XML payload, then puts it all back 
20   * together again.
21   */
22  public class PrettyLoggingInInterceptor extends LoggingInInterceptor
23  {
24      public PrettyLoggingInInterceptor()
25      {
26          super();
27      }
28  
29      public PrettyLoggingInInterceptor(String phase)
30      {
31          super(phase);
32      }
33  
34      public PrettyLoggingInInterceptor(int lim)
35      {
36          super(lim);
37      }
38  
39      public PrettyLoggingInInterceptor(PrintWriter w)
40      {
41          super(w);
42      }
43  
44      @Override
45      protected String transform(String originalLogString)
46      {
47          return PrettyLoggingFeature.formatXmlPayload(originalLogString);
48      }
49  }