org.apache.cxf.interceptor
Class AbstractLoggingInterceptor
java.lang.Object
org.apache.cxf.phase.AbstractPhaseInterceptor<Message>
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.
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 |
limit
protected int limit
writer
protected PrintWriter writer
prettyLogging
protected boolean prettyLogging
AbstractLoggingInterceptor
public AbstractLoggingInterceptor(String phase)
AbstractLoggingInterceptor
public AbstractLoggingInterceptor(String id,
String phase)
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