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 |
BINARY_CONTENT_MESSAGE
protected static final String BINARY_CONTENT_MESSAGE
- See Also:
- Constant Field Values
limit
protected int limit
threshold
protected long threshold
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()
setInMemThreshold
public void setInMemThreshold(long t)
getInMemThreshold
public long getInMemThreshold()
writePayload
protected void writePayload(StringBuilder builder,
CachedOutputStream cos,
String encoding,
String contentType)
throws Exception
- Throws:
Exception
writePayload
protected void writePayload(StringBuilder builder,
StringWriter stringWriter,
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(Logger logger,
String message)
setShowBinaryContent
public void setShowBinaryContent(boolean showBinaryContent)
isShowBinaryContent
public boolean isShowBinaryContent()
isBinaryContent
public boolean isBinaryContent(String contentType)
Apache CXF