Package org.apache.logging.log4j.status
Class StatusLogger.Config
- java.lang.Object
-
- org.apache.logging.log4j.status.StatusLogger.Config
-
- Enclosing class:
- StatusLogger
public static final class StatusLogger.Config extends java.lang.ObjectHolder for user-providedStatusLoggerconfigurations.- Since:
- 2.23.0
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intbufferCapacity(package private) booleandebugEnabled(package private) @Nullable LevelfallbackListenerLevelprivate static StatusLogger.ConfigINSTANCE(package private) @Nullable java.time.format.DateTimeFormatterinstantFormatter
-
Constructor Summary
Constructors Modifier Constructor Description privateConfig()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.privateConfig(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.ConfiggetInstance()Gets the static instance.private static intreadBufferCapacity(java.util.Map<java.lang.String,java.lang.Object> normalizedProperties)private static booleanreadDebugEnabled(java.util.Map<java.lang.String,java.lang.Object> normalizedProperties)private static LevelreadFallbackListenerLevel(java.util.Map<java.lang.String,java.lang.Object> normalizedProperties)private static @Nullable java.time.format.DateTimeFormatterreadInstantFormatter(java.util.Map<java.lang.String,java.lang.Object> normalizedProperties)
-
-
-
Field Detail
-
INSTANCE
private static final StatusLogger.Config INSTANCE
-
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 usegetInstance()instead!- Parameters:
debugEnabled- the value of the "log4j2.debug" propertybufferCapacity- the value of the "log4j2.status.entries" propertyinstantFormatter- 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)
-
-