Package org.elasticsearch.common.logging
Class ClusterIdConverter
java.lang.Object
org.apache.logging.log4j.core.pattern.AbstractPatternConverter
org.apache.logging.log4j.core.pattern.LogEventPatternConverter
org.elasticsearch.common.logging.ClusterIdConverter
- All Implemented Interfaces:
org.apache.logging.log4j.core.pattern.PatternConverter
@Plugin(category="Converter",
name="ClusterIdConverter")
public final class ClusterIdConverter
extends org.apache.logging.log4j.core.pattern.LogEventPatternConverter
Pattern converter to format the cluster_id variable into JSON fields
cluster.id
.
This is used in `EcsJsonLayout`, which does not use NodeAndClusterIdConverter
.
-
Field Summary
Fields inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter
LOGGER
Fields inherited from interface org.apache.logging.log4j.core.pattern.PatternConverter
CATEGORY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
format
(org.apache.logging.log4j.core.LogEvent event, StringBuilder toAppendTo) Formats the cluster.uuid into json fields.static ClusterIdConverter
newInstance
(String[] options) Called by log4j2 to initialize this converter.Methods inherited from class org.apache.logging.log4j.core.pattern.LogEventPatternConverter
format, handlesThrowable, isVariable
Methods inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter
getName, getStyleClass
-
Constructor Details
-
ClusterIdConverter
public ClusterIdConverter()
-
-
Method Details
-
newInstance
Called by log4j2 to initialize this converter. -
format
Formats the cluster.uuid into json fields.- Specified by:
format
in classorg.apache.logging.log4j.core.pattern.LogEventPatternConverter
- Parameters:
event
- - a log event is ignored in this method as it uses the clusterId value fromNodeAndClusterIdStateListener
to format
-