Class ScriptPatternSelector
- java.lang.Object
-
- org.apache.logging.log4j.core.layout.ScriptPatternSelector
-
- All Implemented Interfaces:
PatternSelector
@Plugin(name="ScriptPatternSelector", category="Core", elementType="patternSelector", printObject=true) public class ScriptPatternSelector extends java.lang.Object implements PatternSelector
Selects the pattern to use based on the Marker in the LogEvent.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScriptPatternSelector.BuilderCustom ScriptPatternSelector builder.
-
Field Summary
-
Fields inherited from interface org.apache.logging.log4j.core.layout.PatternSelector
ELEMENT_TYPE
-
-
Constructor Summary
Constructors Constructor Description ScriptPatternSelector(AbstractScript script, PatternMatch[] properties, java.lang.String defaultPattern, boolean alwaysWriteExceptions, boolean disableAnsi, boolean noConsoleNoAnsi, Configuration config)Deprecated.UsenewBuilder()instead.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ScriptPatternSelectorcreateSelector(AbstractScript script, PatternMatch[] properties, java.lang.String defaultPattern, boolean alwaysWriteExceptions, boolean noConsoleNoAnsi, Configuration configuration)Deprecated.UsenewBuilder()instead.PatternFormatter[]getFormatters(LogEvent event)static ScriptPatternSelector.BuildernewBuilder()Creates a builder for a custom ScriptPatternSelector.java.lang.StringtoString()
-
-
-
Constructor Detail
-
ScriptPatternSelector
@Deprecated public ScriptPatternSelector(AbstractScript script, PatternMatch[] properties, java.lang.String defaultPattern, boolean alwaysWriteExceptions, boolean disableAnsi, boolean noConsoleNoAnsi, Configuration config)
Deprecated.UsenewBuilder()instead. This will be private in a future version.
-
-
Method Detail
-
getFormatters
public PatternFormatter[] getFormatters(LogEvent event)
- Specified by:
getFormattersin interfacePatternSelector
-
newBuilder
@PluginBuilderFactory public static ScriptPatternSelector.Builder newBuilder()
Creates a builder for a custom ScriptPatternSelector.- Returns:
- a ScriptPatternSelector builder.
-
createSelector
@Deprecated public static ScriptPatternSelector createSelector(AbstractScript script, PatternMatch[] properties, java.lang.String defaultPattern, boolean alwaysWriteExceptions, boolean noConsoleNoAnsi, Configuration configuration)
Deprecated.UsenewBuilder()instead.Deprecated, usenewBuilder()instead.- Parameters:
script-properties-defaultPattern-alwaysWriteExceptions-noConsoleNoAnsi-configuration-- Returns:
- a new ScriptPatternSelector
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-