Class StatusLogger.Config

  • Enclosing class:
    StatusLogger

    public static final class StatusLogger.Config
    extends java.lang.Object
    Holder for user-provided StatusLogger configurations.
    Since:
    2.23.0
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Config()
      Constructs the default instance using system properties and a property file (i.e., "log4j2.StatusLogger.properties") in the classpath, if available.
        Config​(boolean debugEnabled, int bufferCapacity, @Nullable java.time.format.DateTimeFormatter instantFormatter)
      Constructs an instance using the given properties.
      private Config​(java.util.Map<java.lang.String,​java.lang.Object> normalizedProperties)
      The lowest-level constructor.
      (package private) Config​(java.util.Properties... propertiesList)
      A low-level constructor intended for tests.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static StatusLogger.Config getInstance()
      Gets the static instance.
      private static int readBufferCapacity​(java.util.Map<java.lang.String,​java.lang.Object> normalizedProperties)  
      private static boolean readDebugEnabled​(java.util.Map<java.lang.String,​java.lang.Object> normalizedProperties)  
      private static Level readFallbackListenerLevel​(java.util.Map<java.lang.String,​java.lang.Object> normalizedProperties)  
      private static @Nullable java.time.format.DateTimeFormatter readInstantFormatter​(java.util.Map<java.lang.String,​java.lang.Object> normalizedProperties)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • debugEnabled

        final boolean debugEnabled
      • bufferCapacity

        final int bufferCapacity
      • fallbackListenerLevel

        final @Nullable Level fallbackListenerLevel
      • instantFormatter

        final @Nullable java.time.format.DateTimeFormatter instantFormatter
    • Constructor Detail

      • Config

        public Config​(boolean debugEnabled,
                      int bufferCapacity,
                      @Nullable java.time.format.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., "log4j2.StatusLogger.properties") in the classpath, if available.
      • Config

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

        private Config​(java.util.Map<java.lang.String,​java.lang.Object> normalizedProperties)
        The lowest-level constructor.
    • Method Detail

      • getInstance

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

        private static boolean readDebugEnabled​(java.util.Map<java.lang.String,​java.lang.Object> normalizedProperties)
      • readBufferCapacity

        private static int readBufferCapacity​(java.util.Map<java.lang.String,​java.lang.Object> normalizedProperties)
      • readFallbackListenerLevel

        private static Level readFallbackListenerLevel​(java.util.Map<java.lang.String,​java.lang.Object> normalizedProperties)
      • readInstantFormatter

        private static @Nullable java.time.format.DateTimeFormatter readInstantFormatter​(java.util.Map<java.lang.String,​java.lang.Object> normalizedProperties)