Class LevelPatternSelector
java.lang.Object
org.apache.logging.log4j.core.layout.LevelPatternSelector
- All Implemented Interfaces:
LocationAware,PatternSelector
@Plugin(name="LevelPatternSelector",
category="Core",
elementType="patternSelector",
printObject=true)
public class LevelPatternSelector
extends Object
implements PatternSelector, LocationAware
Selects the pattern to use based on the Level in the LogEvent.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCustom MarkerPatternSelector builder. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PatternFormatter[]private final Stringprivate final Map<String, PatternFormatter[]> private static Loggerprivate final booleanFields inherited from interface org.apache.logging.log4j.core.layout.PatternSelector
ELEMENT_TYPE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateLevelPatternSelector(PatternMatch[] properties, String defaultPattern, boolean alwaysWriteExceptions, boolean disableAnsi, boolean noConsoleNoAnsi, Configuration config) LevelPatternSelector(PatternMatch[] properties, String defaultPattern, boolean alwaysWriteExceptions, boolean noConsoleNoAnsi, Configuration config) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic LevelPatternSelectorcreateSelector(PatternMatch[] properties, String defaultPattern, boolean alwaysWriteExceptions, boolean noConsoleNoAnsi, Configuration configuration) Deprecated.UsenewBuilder()instead.getFormatters(LogEvent event) static LevelPatternSelector.BuilderCreates a builder for a custom ScriptPatternSelector.booleantoString()
-
Field Details
-
formatterMap
-
patternMap
-
defaultFormatters
-
defaultPattern
-
LOGGER
-
requiresLocation
private final boolean requiresLocation
-
-
Constructor Details
-
LevelPatternSelector
@Deprecated public LevelPatternSelector(PatternMatch[] properties, String defaultPattern, boolean alwaysWriteExceptions, boolean noConsoleNoAnsi, Configuration config) Deprecated.UsenewBuilder()instead. This will be private in a future version. -
LevelPatternSelector
private LevelPatternSelector(PatternMatch[] properties, String defaultPattern, boolean alwaysWriteExceptions, boolean disableAnsi, boolean noConsoleNoAnsi, Configuration config)
-
-
Method Details
-
requiresLocation
public boolean requiresLocation()- Specified by:
requiresLocationin interfaceLocationAware
-
getFormatters
- Specified by:
getFormattersin interfacePatternSelector
-
newBuilder
Creates a builder for a custom ScriptPatternSelector.- Returns:
- a ScriptPatternSelector builder.
-
createSelector
@Deprecated public static LevelPatternSelector createSelector(PatternMatch[] properties, String defaultPattern, boolean alwaysWriteExceptions, boolean noConsoleNoAnsi, Configuration configuration) Deprecated.UsenewBuilder()instead.Deprecated, usenewBuilder()instead.- Parameters:
properties-defaultPattern-alwaysWriteExceptions-noConsoleNoAnsi-configuration-- Returns:
- a new MarkerPatternSelector.
-
toString
-
newBuilder()instead.