Apache CXF API

org.apache.cxf.interceptor
Class LoggingInInterceptor

java.lang.Object
  extended by org.apache.cxf.phase.AbstractPhaseInterceptor<Message>
      extended by org.apache.cxf.interceptor.LoggingInInterceptor
All Implemented Interfaces:
Interceptor<Message>, PhaseInterceptor<Message>

public class LoggingInInterceptor
extends AbstractPhaseInterceptor<Message>

A simple logging handler which outputs the bytes of the message to the Logger.


Constructor Summary
LoggingInInterceptor()
           
LoggingInInterceptor(int lim)
           
LoggingInInterceptor(PrintWriter w)
           
LoggingInInterceptor(String phase)
           
 
Method Summary
 int getLimit()
           
 PrintWriter getPrintWriter()
           
 void handleMessage(Message message)
          Intercepts a message.
 boolean isPrettyLogging()
           
 void setLimit(int lim)
           
 void setPrettyLogging(boolean flag)
           
 void setPrintWriter(PrintWriter w)
           
protected  String transform(String originalLogString)
          Transform the string before display.
protected  void writePayload(StringBuilder builder, CachedOutputStream cos, String encoding, String contentType)
           
 
Methods inherited from class org.apache.cxf.phase.AbstractPhaseInterceptor
addAfter, addAfter, addBefore, addBefore, getAfter, getBefore, getId, getPhase, handleFault, isGET, isRequestor, setAfter, setBefore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingInInterceptor

public LoggingInInterceptor()

LoggingInInterceptor

public LoggingInInterceptor(String phase)

LoggingInInterceptor

public LoggingInInterceptor(int lim)

LoggingInInterceptor

public LoggingInInterceptor(PrintWriter w)
Method Detail

setPrettyLogging

public void setPrettyLogging(boolean flag)

isPrettyLogging

public boolean isPrettyLogging()

setPrintWriter

public void setPrintWriter(PrintWriter w)

getPrintWriter

public PrintWriter getPrintWriter()

setLimit

public void setLimit(int lim)

getLimit

public int getLimit()

handleMessage

public void handleMessage(Message message)
                   throws Fault
Description copied from interface: Interceptor
Intercepts a message. Interceptors should NOT invoke handleMessage or handleFault on the next interceptor - the interceptor chain will take care of this.

Throws:
Fault

transform

protected String transform(String originalLogString)
Transform the string before display. The implementation in this class does nothing. Override this method if you want to change the contents of the logged message before it is delivered to the output. For example, you can use this to mask out sensitive information.

Parameters:
originalLogString - the raw log message.
Returns:
transformed data

writePayload

protected void writePayload(StringBuilder builder,
                            CachedOutputStream cos,
                            String encoding,
                            String contentType)
                     throws Exception
Throws:
Exception

Apache CXF API

Apache CXF