Package org.elasticsearch.common.logging
Class ESLogMessage
java.lang.Object
org.apache.logging.log4j.message.MapMessage<ESLogMessage,Object>
org.elasticsearch.common.logging.ESLogMessage
- All Implemented Interfaces:
Serializable
,org.apache.logging.log4j.message.Message
,org.apache.logging.log4j.message.MultiformatMessage
,org.apache.logging.log4j.util.MultiFormatStringBuilderFormattable
,org.apache.logging.log4j.util.StringBuilderFormattable
A base class for custom log4j logger messages. Carries additional fields which will populate JSON fields in logs.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.logging.log4j.message.MapMessage
org.apache.logging.log4j.message.MapMessage.MapFormat
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
This method is used in order to support ESJsonLayout which replaces %CustomMapFields from a pattern with JSON fields It is a modified version ofMapMessage.asJson(StringBuilder)
where the curly brackets are not addedargAndField
(String key, Object value) static String
asJsonArray
(Stream<String> stream) Object[]
static String
static String
withFields
(Map<String, Object> prepareMap) Methods inherited from class org.apache.logging.log4j.message.MapMessage
appendMap, asJava, asJavaUnquoted, asJson, asString, asString, asXml, clear, containsKey, equals, forEach, forEach, formatTo, formatTo, get, getData, getFormat, getFormats, getFormattedMessage, getFormattedMessage, getIndexedReadOnlyStringMap, getParameters, getThrowable, hashCode, newInstance, put, putAll, remove, toKey, toString, validate, validate, validate, validate, validate, validate, validate, validate, validate, validate, with, with, with, with, with, with, with, with, with, with
-
Constructor Details
-
ESLogMessage
-
ESLogMessage
public ESLogMessage()
-
-
Method Details
-
argAndField
-
field
-
withFields
-
addJsonNoBrackets
This method is used in order to support ESJsonLayout which replaces %CustomMapFields from a pattern with JSON fields It is a modified version ofMapMessage.asJson(StringBuilder)
where the curly brackets are not added- Parameters:
sb
- a string builder where JSON fields will be attached
-
inQuotes
-
inQuotes
-
asJsonArray
-
getArguments
-
getMessagePattern
-