public class ContextDataFactory extends Object
By default returns SortedArrayStringMap
objects. Can be configured by setting system property
"log4j2.ContextData"
to the fully qualified class name of a class implementing the StringMap
interface. The class must have a public default constructor, and if possible should also have a public constructor
that takes a single int
argument for the initial capacity.
LogEvent.getContextData()
,
ContextDataInjector
,
SortedArrayStringMap
Constructor and Description |
---|
ContextDataFactory() |
Modifier and Type | Method and Description |
---|---|
static StringMap |
createContextData() |
static StringMap |
createContextData(int initialCapacity) |
static StringMap |
createContextData(Map<String,String> context) |
static StringMap |
createContextData(ReadOnlyStringMap readOnlyStringMap) |
static StringMap |
emptyFrozenContextData()
An empty pre-frozen IndexedStringMap.
|
public static StringMap createContextData()
public static StringMap createContextData(int initialCapacity)
public static StringMap createContextData(ReadOnlyStringMap readOnlyStringMap)
public static StringMap emptyFrozenContextData()
Copyright © 1999-2023 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.