Apache CXF API

org.apache.cxf.interceptor
Class AbstractLoggingInterceptor

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

public abstract class AbstractLoggingInterceptor
extends AbstractPhaseInterceptor<Message>

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


Field Summary
protected  int limit
           
protected  boolean prettyLogging
           
protected  PrintWriter writer
           
 
Constructor Summary
AbstractLoggingInterceptor(String phase)
           
AbstractLoggingInterceptor(String id, String phase)
           
 
Method Summary
 int getLimit()
           
protected abstract  Logger getLogger()
           
 PrintWriter getPrintWriter()
           
 boolean isPrettyLogging()
           
protected  void log(String message)
           
 void setLimit(int lim)
           
 void setOutputLocation(String s)
           
 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, getAdditionalInterceptors, 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
 
Methods inherited from interface org.apache.cxf.interceptor.Interceptor
handleMessage
 

Field Detail

limit

protected int limit

writer

protected PrintWriter writer

prettyLogging

protected boolean prettyLogging
Constructor Detail

AbstractLoggingInterceptor

public AbstractLoggingInterceptor(String phase)

AbstractLoggingInterceptor

public AbstractLoggingInterceptor(String id,
                                  String phase)
Method Detail

getLogger

protected abstract Logger getLogger()

setOutputLocation

public void setOutputLocation(String s)

setPrintWriter

public void setPrintWriter(PrintWriter w)

getPrintWriter

public PrintWriter getPrintWriter()

setLimit

public void setLimit(int lim)

getLimit

public int getLimit()

setPrettyLogging

public void setPrettyLogging(boolean flag)

isPrettyLogging

public boolean isPrettyLogging()

writePayload

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

transform

protected String transform(String originalLogString)
Transform the string before display. The implementation in this class does nothing. Override this method if you wish 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

log

protected void log(String message)

Apache CXF API

Apache CXF