Class MDCBasedDiscriminator

    • Constructor Detail

      • MDCBasedDiscriminator

        public MDCBasedDiscriminator()
    • Method Detail

      • getDiscriminatingValue

        public String getDiscriminatingValue​(ILoggingEvent event)
        Return the value associated with an MDC entry designated by the Key property. If that value is null, then return the value assigned to the DefaultValue property.
      • getKey

        public String getKey()
        Description copied from interface: Discriminator
        The key or variable name under which the discriminating value should be exported into the host environment.
      • setKey

        public void setKey​(String key)
      • setDefaultValue

        public void setDefaultValue​(String defaultValue)
        The default MDC value in case the MDC is not set for mdcKey.

        For example, if Key is set to the value "someKey", and the MDC is not set for "someKey", then this appender will use the default value, which you can set with the help of this method.

        defaultValue -