Class ProductOriginConverter

java.lang.Object
org.apache.logging.log4j.core.pattern.AbstractPatternConverter
org.apache.logging.log4j.core.pattern.LogEventPatternConverter
org.elasticsearch.common.logging.ProductOriginConverter
All Implemented Interfaces:
org.apache.logging.log4j.core.pattern.PatternConverter

@Plugin(category="Converter", name="ProductOriginConverter") public final class ProductOriginConverter extends org.apache.logging.log4j.core.pattern.LogEventPatternConverter
Pattern converter to format the X-elastic-product-origin into plaintext logs.
  • Field Summary

    Fields inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter

    LOGGER

    Fields inherited from interface org.apache.logging.log4j.core.pattern.PatternConverter

    CATEGORY
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    format(org.apache.logging.log4j.core.LogEvent event, StringBuilder toAppendTo)
    Formats the X-elastic-product-origin into plaintext logs/
    static String
     
    newInstance(String[] options)
    Called by log4j2 to initialize this converter.

    Methods inherited from class org.apache.logging.log4j.core.pattern.LogEventPatternConverter

    format, handlesThrowable, isVariable

    Methods inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter

    getName, getStyleClass

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ProductOriginConverter

      public ProductOriginConverter()
  • Method Details

    • newInstance

      public static ProductOriginConverter newInstance(String[] options)
      Called by log4j2 to initialize this converter.
    • getProductOrigin

      public static String getProductOrigin()
    • format

      public void format(org.apache.logging.log4j.core.LogEvent event, StringBuilder toAppendTo)
      Formats the X-elastic-product-origin into plaintext logs/
      Specified by:
      format in class org.apache.logging.log4j.core.pattern.LogEventPatternConverter
      Parameters:
      event - - a log event is ignored in this method as it uses the value from ThreadContext from NodeAndClusterIdStateListener to format