Class SoapMessageLoggingOutInterceptor

  • All Implemented Interfaces:
    org.apache.cxf.interceptor.Interceptor<org.apache.cxf.message.Message>, org.apache.cxf.phase.PhaseInterceptor<org.apache.cxf.message.Message>

    public class SoapMessageLoggingOutInterceptor
    extends org.apache.cxf.interceptor.LoggingOutInterceptor
    This Apache CXF Logging Interceptor extracts the SoapMessage and logs it dependent on the the setted logSoapMessage(boolean) or extractSoapMessage(boolean).

    If logSoapMessage(boolean) is set to true, the SoapMessage is logged to commandline respectively STOUT

    If extractSoapMessage(boolean) is set to true, the BaseLogger is used to put the SoapMessage into the Slf4j MDC (Mapped Diagnostic Context, see http://logback.qos.ch/manual/mdc.html} for more details) with a Key directly suitable for processing with the ELK-Stack (Elasticsearch, Logstash, Kibana).

    If both are set to true, the SoapMessage is logged to commandline AND put into Slf4j MDC for Elasticsearch processing.

    Author:
    Jonas Hecht
    • Field Summary

      • Fields inherited from class org.apache.cxf.interceptor.AbstractLoggingInterceptor

        BINARY_CONTENT_MESSAGE, DEFAULT_LIMIT, limit, MULTIPART_CONTENT_MESSAGE, prettyLogging, threshold, writer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void extractSoapMessage​(boolean active)  
      protected String formatLoggingMessage​(org.apache.cxf.interceptor.LoggingMessage loggingMessage)  
      protected void log​(Logger logger, String message)  
      void logSoapMessage​(boolean active)  
      • Methods inherited from class org.apache.cxf.interceptor.LoggingOutInterceptor

        getLogger, handleMessage
      • Methods inherited from class org.apache.cxf.interceptor.AbstractLoggingInterceptor

        getBinaryContentMediaTypes, getInMemThreshold, getLimit, getPrintWriter, isBinaryContent, isLoggingDisabledNow, isMultipartContent, isPrettyLogging, isShowBinaryContent, isShowMultipartContent, setBinaryContentMediaTypes, setInMemThreshold, setLimit, setOutputLocation, setPrettyLogging, setPrintWriter, setShowBinaryContent, setShowMultipartContent, transform, writePayload, writePayload, writePrettyPayload
      • Methods inherited from class org.apache.cxf.phase.AbstractPhaseInterceptor

        addAfter, addAfter, addBefore, addBefore, getAdditionalInterceptors, getAfter, getBefore, getId, getPhase, handleFault, isGET, isRequestor, setAfter, setBefore
    • Constructor Detail

      • SoapMessageLoggingOutInterceptor

        public SoapMessageLoggingOutInterceptor()
    • Method Detail

      • log

        protected void log​(Logger logger,
                           String message)
        Overrides:
        log in class org.apache.cxf.interceptor.AbstractLoggingInterceptor
      • formatLoggingMessage

        protected String formatLoggingMessage​(org.apache.cxf.interceptor.LoggingMessage loggingMessage)
        Overrides:
        formatLoggingMessage in class org.apache.cxf.interceptor.LoggingOutInterceptor
      • logSoapMessage

        public void logSoapMessage​(boolean active)
      • extractSoapMessage

        public void extractSoapMessage​(boolean active)