- java.lang.Object
-
- java.lang.Enum<LoggingSystemProperty>
-
- org.apache.logging.log4j.spi.LoggingSystemProperty
-
- All Implemented Interfaces:
Serializable
,Comparable<LoggingSystemProperty>
,PropertyKey
public enum LoggingSystemProperty extends Enum<LoggingSystemProperty> implements PropertyKey
Centralized list of property name constants that can be configured in the Log4j API. These properties may be specified as system properties, environment variables (seeEnvironmentPropertySource
), or in a classpath resource file namedlog4j2.component.properties
.- Since:
- 3.0.0
- See Also:
PropertiesUtil
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LoggingSystemProperty.Constant
-
Enum Constant Summary
Enum Constants Enum Constant Description GC_REUSABLE_MESSAGE_MAX_SIZE
Property to override the maximum size of the StringBuilder instances used in ringbuffer log events to store the contents of reusable messages.IS_WEBAPP
Property to override webapp detection.LOADER_FORCE_THREAD_CONTEXT_LOADER
Property to force use of the thread context ClassLoader.LOADER_IGNORE_THREAD_CONTEXT_LOADER
Property to ignore the thread context ClassLoader when set totrue
.LOGGER_CONTEXT_FACTORY_CLASS
Property to set to the fully qualified class name of a custom implementation ofLoggerContextFactory
.LOGGER_FLOW_MESSAGE_FACTORY_CLASS
Property to override the defaultFlowMessageFactory
class.LOGGER_MAP_MESSAGE_JSON_FORMATTER_MAX_DEPTH
Property to override the default maximum nesting depth of map messages to format in JSON output.LOGGER_MESSAGE_FACTORY_CLASS
Property to override the defaultMessageFactory
class.SIMPLE_DATE_TIME_FORMAT
SIMPLE_LOG_FILE
SIMPLE_LOG_LEVEL
SIMPLE_SHOW_CONTEXT_MAP
SIMPLE_SHOW_DATE_TIME
SIMPLE_SHOW_LOG_NAME
SIMPLE_SHOW_SHORT_LOG_NAME
STATUS_DATE_FORMAT
Property that can be configured with a date-time format string to use as the format for timestamps in the status logger output.STATUS_DEFAULT_LISTENER_LEVEL
Property that can be configured with theLevel
name to use as the default level forStatusListener
s.STATUS_LOGGER_DEBUG
Property to enable TRACE-level debug logging in the Log4j system itself.STATUS_MAX_ENTRIES
Property that can be configured with the maximum number of status data entries to keep queued.THREAD_CONTEXT_ENABLE
Property to control whetherThreadContext
stores any data.THREAD_CONTEXT_GARBAGE_FREE_ENABLED
Property to override whether to use a garbage-free implementation ofThreadContextMap
.THREAD_CONTEXT_INITIAL_CAPACITY
Property to override the initial capacity of the thread context map.THREAD_CONTEXT_MAP_CLASS
Property to override the defaultThreadContextMap
class.THREAD_CONTEXT_MAP_ENABLED
Property to control whetherThreadContext
stores map data.THREAD_CONTEXT_MAP_INHERITABLE
Property to control whetherThreadContextMap
usesInheritableThreadLocal
whentrue
orThreadLocal
otherwise for holding map data.THREAD_CONTEXT_STACK_ENABLED
Property to control whetherThreadContext
stores stack data.THREAD_LOCALS_ENABLE
Property to override the use of thread-local values for garbage-free logging.UNBOX_RING_BUFFER_SIZE
Property to override the default ringbuffer size used inUnbox
.
-
Field Summary
Fields Modifier and Type Field Description static String
SIMPLE_LOGGER_LOG_LEVEL
static String
SYSTEM_PROPERTY_PREFIX
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LoggingSystemProperty
findKey(String component, String name)
String
getComponent()
String
getKey()
String
getName()
String
getSystemKey()
String
toString()
static LoggingSystemProperty
valueOf(String name)
Returns the enum constant of this type with the specified name.static LoggingSystemProperty[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
GC_REUSABLE_MESSAGE_MAX_SIZE
public static final LoggingSystemProperty GC_REUSABLE_MESSAGE_MAX_SIZE
Property to override the maximum size of the StringBuilder instances used in ringbuffer log events to store the contents of reusable messages. After delivering messages above this size to appenders, the StringBuilder is trimmed to this maximum size. The default value is 518 which allows the StringBuilder to resize three times from its initial size.
-
THREAD_LOCALS_ENABLE
public static final LoggingSystemProperty THREAD_LOCALS_ENABLE
Property to override the use of thread-local values for garbage-free logging.- See Also:
- LOG4J2-1270
-
LOADER_IGNORE_THREAD_CONTEXT_LOADER
public static final LoggingSystemProperty LOADER_IGNORE_THREAD_CONTEXT_LOADER
Property to ignore the thread context ClassLoader when set totrue
.- See Also:
LoaderUtil
-
LOADER_FORCE_THREAD_CONTEXT_LOADER
public static final LoggingSystemProperty LOADER_FORCE_THREAD_CONTEXT_LOADER
Property to force use of the thread context ClassLoader.- See Also:
LoaderUtil
-
LOGGER_CONTEXT_FACTORY_CLASS
public static final LoggingSystemProperty LOGGER_CONTEXT_FACTORY_CLASS
Property to set to the fully qualified class name of a custom implementation ofLoggerContextFactory
.
-
LOGGER_MESSAGE_FACTORY_CLASS
public static final LoggingSystemProperty LOGGER_MESSAGE_FACTORY_CLASS
Property to override the defaultMessageFactory
class.
-
LOGGER_FLOW_MESSAGE_FACTORY_CLASS
public static final LoggingSystemProperty LOGGER_FLOW_MESSAGE_FACTORY_CLASS
Property to override the defaultFlowMessageFactory
class.
-
LOGGER_MAP_MESSAGE_JSON_FORMATTER_MAX_DEPTH
public static final LoggingSystemProperty LOGGER_MAP_MESSAGE_JSON_FORMATTER_MAX_DEPTH
Property to override the default maximum nesting depth of map messages to format in JSON output. The default value is 8.
-
SIMPLE_SHOW_CONTEXT_MAP
public static final LoggingSystemProperty SIMPLE_SHOW_CONTEXT_MAP
-
SIMPLE_SHOW_LOG_NAME
public static final LoggingSystemProperty SIMPLE_SHOW_LOG_NAME
-
SIMPLE_SHOW_SHORT_LOG_NAME
public static final LoggingSystemProperty SIMPLE_SHOW_SHORT_LOG_NAME
-
SIMPLE_SHOW_DATE_TIME
public static final LoggingSystemProperty SIMPLE_SHOW_DATE_TIME
-
SIMPLE_DATE_TIME_FORMAT
public static final LoggingSystemProperty SIMPLE_DATE_TIME_FORMAT
-
SIMPLE_LOG_FILE
public static final LoggingSystemProperty SIMPLE_LOG_FILE
-
SIMPLE_LOG_LEVEL
public static final LoggingSystemProperty SIMPLE_LOG_LEVEL
-
STATUS_MAX_ENTRIES
public static final LoggingSystemProperty STATUS_MAX_ENTRIES
Property that can be configured with the maximum number of status data entries to keep queued. Once the limit is reached, older entries will be removed as new entries are added. The default value is 200.
-
STATUS_DEFAULT_LISTENER_LEVEL
public static final LoggingSystemProperty STATUS_DEFAULT_LISTENER_LEVEL
Property that can be configured with theLevel
name to use as the default level forStatusListener
s. The default value isLevel.WARN
.
-
STATUS_DATE_FORMAT
public static final LoggingSystemProperty STATUS_DATE_FORMAT
Property that can be configured with a date-time format string to use as the format for timestamps in the status logger output. SeeSimpleDateFormat
for supported formats.
-
STATUS_LOGGER_DEBUG
public static final LoggingSystemProperty STATUS_LOGGER_DEBUG
Property to enable TRACE-level debug logging in the Log4j system itself.If property is either defined empty or its value equals to
true
(ignoring case), all internal logging will be printed to the console. The presence of this system property overrides any value set in the configuration's<Configuration status="<level>" ...>
status attribute.
-
THREAD_CONTEXT_MAP_ENABLED
public static final LoggingSystemProperty THREAD_CONTEXT_MAP_ENABLED
Property to control whetherThreadContext
stores map data. If set totrue
, then the thread context map will be disabled.
-
THREAD_CONTEXT_STACK_ENABLED
public static final LoggingSystemProperty THREAD_CONTEXT_STACK_ENABLED
Property to control whetherThreadContext
stores stack data. If set totrue
, then the thread context stack will be disabled.
-
THREAD_CONTEXT_ENABLE
public static final LoggingSystemProperty THREAD_CONTEXT_ENABLE
Property to control whetherThreadContext
stores any data. If set totrue
, then the thread context map and stack will be disabled.
-
THREAD_CONTEXT_MAP_INHERITABLE
public static final LoggingSystemProperty THREAD_CONTEXT_MAP_INHERITABLE
Property to control whetherThreadContextMap
usesInheritableThreadLocal
whentrue
orThreadLocal
otherwise for holding map data.
-
THREAD_CONTEXT_MAP_CLASS
public static final LoggingSystemProperty THREAD_CONTEXT_MAP_CLASS
Property to override the defaultThreadContextMap
class. Note that implementation classes should also implementReadOnlyThreadContextMap
if they should be accessible to applications viaThreadContext.getThreadContextMap()
.
-
THREAD_CONTEXT_INITIAL_CAPACITY
public static final LoggingSystemProperty THREAD_CONTEXT_INITIAL_CAPACITY
Property to override the initial capacity of the thread context map. The default value is 16.
-
THREAD_CONTEXT_GARBAGE_FREE_ENABLED
public static final LoggingSystemProperty THREAD_CONTEXT_GARBAGE_FREE_ENABLED
Property to override whether to use a garbage-free implementation ofThreadContextMap
.
-
UNBOX_RING_BUFFER_SIZE
public static final LoggingSystemProperty UNBOX_RING_BUFFER_SIZE
Property to override the default ringbuffer size used inUnbox
. The default value is 32.
-
IS_WEBAPP
public static final LoggingSystemProperty IS_WEBAPP
Property to override webapp detection. Without this property, the presence of theServlet
interface (from eitherjavax
orjakarta
) is checked to see if this is a webapp.
-
-
Field Detail
-
SIMPLE_LOGGER_LOG_LEVEL
public static final String SIMPLE_LOGGER_LOG_LEVEL
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_PREFIX
public static final String SYSTEM_PROPERTY_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static LoggingSystemProperty[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (LoggingSystemProperty c : LoggingSystemProperty.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static LoggingSystemProperty valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
findKey
public static LoggingSystemProperty findKey(String component, String name)
-
getComponent
public String getComponent()
- Specified by:
getComponent
in interfacePropertyKey
-
getName
public String getName()
- Specified by:
getName
in interfacePropertyKey
-
getKey
public String getKey()
- Specified by:
getKey
in interfacePropertyKey
-
getSystemKey
public String getSystemKey()
- Specified by:
getSystemKey
in interfacePropertyKey
-
toString
public String toString()
- Specified by:
toString
in interfacePropertyKey
- Overrides:
toString
in classEnum<LoggingSystemProperty>
-
-