Class LoggingFeature

java.lang.Object
jakarta.xml.ws.WebServiceFeature
org.apache.cxf.feature.AbstractFeature
org.apache.cxf.feature.DelegatingFeature<LoggingFeature.Portable>
org.apache.cxf.ext.logging.LoggingFeature
All Implemented Interfaces:
org.apache.cxf.feature.AbstractPortableFeature, org.apache.cxf.feature.Feature

public class LoggingFeature extends org.apache.cxf.feature.DelegatingFeature<LoggingFeature.Portable>
This class is used to control message-on-the-wire logging. By attaching this feature to an endpoint, you can specify logging. If this feature is present, an endpoint will log input and output of ordinary and log messages.
 <![CDATA[
    <jaxws:endpoint ...>
      <jaxws:features>
       
      </jaxws:features>
    </jaxws:endpoint>
  ]]>
  
  • Constructor Details

    • LoggingFeature

      public LoggingFeature()
  • Method Details

    • setLimit

      public void setLimit(int limit)
    • setInMemThreshold

      public void setInMemThreshold(long inMemThreshold)
    • setSender

      public void setSender(LogEventSender sender)
    • setInSender

      public void setInSender(LogEventSender s)
    • setOutSender

      public void setOutSender(LogEventSender s)
    • setPrettyLogging

      public void setPrettyLogging(boolean prettyLogging)
    • setLogBinary

      public void setLogBinary(boolean logBinary)
    • setLogMultipart

      public void setLogMultipart(boolean logMultipart)
    • setVerbose

      public void setVerbose(boolean verbose)
    • addInBinaryContentMediaTypes

      public void addInBinaryContentMediaTypes(String mediaTypes)
      Add additional binary media types to the default values in the LoggingInInterceptor. Content for these types will not be logged. For example:
       <bean id="loggingFeature" class="org.apache.cxf.ext.logging.LoggingFeature">
         <property name="addInBinaryContentMediaTypes" value="audio/mpeg;application/zip"/>
       </bean>
       
      Parameters:
      mediaTypes - list of mediaTypes. symbol ; - delimeter
    • addOutBinaryContentMediaTypes

      public void addOutBinaryContentMediaTypes(String mediaTypes)
      Add additional binary media types to the default values in the LoggingOutInterceptor. Content for these types will not be logged. For example:
       <bean id="loggingFeature" class="org.apache.cxf.ext.logging.LoggingFeature">
         <property name="addOutBinaryContentMediaTypes" value="audio/mpeg;application/zip"/>
       </bean>
       
      Parameters:
      mediaTypes - list of mediaTypes. symbol ; - delimeter
    • addBinaryContentMediaTypes

      public void addBinaryContentMediaTypes(String mediaTypes)
      Add additional binary media types to the default values for both logging interceptors Content for these types will not be logged. For example:
       <bean id="loggingFeature" class="org.apache.cxf.ext.logging.LoggingFeature">
         <property name="addBinaryContentMediaTypes" value="audio/mpeg;application/zip"/>
       </bean>
       
      Parameters:
      mediaTypes - list of mediaTypes. symbol ; - delimeter
    • setSensitiveElementNames

      public void setSensitiveElementNames(Set<String> sensitiveElementNames)
      Sets list of XML or JSON elements containing sensitive information to be masked. Corresponded data will be replaced with configured mask For example:
       sensitiveElementNames: {password}
      
       Initial logging statement: my usermy secret password
       Result logging statement: my userXXXX
       
      Parameters:
      sensitiveElementNames - set of sensitive element names to be replaced
    • addSensitiveElementNames

      public void addSensitiveElementNames(Set<String> sensitiveElementNames)
      Adds list of XML or JSON elements containing sensitive information to be masked. Corresponded data will be replaced with configured mask For example:
       sensitiveElementNames: {password}
      
       Initial logging statement: my usermy secret password
       Result logging statement: my userXXXX
       
      Parameters:
      sensitiveElementNames - set of sensitive element names to be replaced
    • setSensitiveProtocolHeaderNames

      public void setSensitiveProtocolHeaderNames(Set<String> sensitiveProtocolHeaderNames)
      Sets list of protocol headers containing sensitive information to be masked. Corresponded data will be replaced with configured mask For example:
       sensitiveHeaders: {Authorization}
      
       Initial logging statement: {Authorization=Basic QWxhZGRpbjpPcGVuU2VzYW1l}
       Result logging statement: {Authorization=XXX}
       
      Parameters:
      sensitiveProtocolHeaderNames - set of sensitive element names to be replaced
    • addSensitiveProtocolHeaderNames

      public void addSensitiveProtocolHeaderNames(Set<String> sensitiveProtocolHeaderNames)
      Adds list of protocol headers containing sensitive information to be masked. Corresponded data will be replaced with configured mask For example:
       sensitiveHeaders: {Authorization}
      
       Initial logging statement: {Authorization=Basic QWxhZGRpbjpPcGVuU2VzYW1l}
       Result logging statement: {Authorization=XXX}
       
      Parameters:
      sensitiveProtocolHeaderNames - set of sensitive element names to be replaced
    • setSensitiveDataHelper

      public void setSensitiveDataHelper(MaskSensitiveHelper maskSensitiveHelper)
      Replaces MaskSensitiveHelper implementation with given one.
      Parameters:
      maskSensitiveHelper - new MaskSensitiveHelper to be used.