Class StatusLogger.Config

java.lang.Object
org.apache.logging.log4j.status.StatusLogger.Config
Enclosing class:
StatusLogger

public static final class StatusLogger.Config extends Object
Holder for user-provided StatusLogger configurations.
Since:
2.23.0
  • Field Details

    • INSTANCE

      private static final StatusLogger.Config INSTANCE
    • debugEnabled

      final boolean debugEnabled
    • bufferCapacity

      final int bufferCapacity
    • fallbackListenerLevel

      final @Nullable Level fallbackListenerLevel
    • instantFormatter

      final @Nullable DateTimeFormatter instantFormatter
  • Constructor Details

    • Config

      public Config(boolean debugEnabled, int bufferCapacity, @Nullable DateTimeFormatter instantFormatter)
      Constructs an instance using the given properties. Users should not create new instances, but use getInstance() instead!
      Parameters:
      debugEnabled - the value of the "log4j2.debug" property
      bufferCapacity - the value of the "log4j2.status.entries" property
      instantFormatter - the value of the "log4j2.StatusLogger.dateFormat" property
    • Config

      private Config()
      Constructs the default instance using system properties and a property file (i.e., ) in the classpath, if available.
    • Config

      Config(Properties... propertiesList)
      A low-level constructor intended for tests.
    • Config

      private Config(Map<String,Object> normalizedProperties)
      The lowest-level constructor.
  • Method Details

    • getInstance

      public static StatusLogger.Config getInstance()
      Gets the static instance.
      Returns:
      a singleton instance
    • readDebugEnabled

      private static boolean readDebugEnabled(Map<String,Object> normalizedProperties)
    • readBufferCapacity

      private static int readBufferCapacity(Map<String,Object> normalizedProperties)
    • readFallbackListenerLevel

      private static Level readFallbackListenerLevel(Map<String,Object> normalizedProperties)
    • readInstantFormatter

      private static @Nullable DateTimeFormatter readInstantFormatter(Map<String,Object> normalizedProperties)