public class MessageJsonProvider extends AbstractFieldJsonProvider<ILoggingEvent> implements FieldNamesAware<LogstashFieldNames>
| Modifier and Type | Field and Description |
|---|---|
static String |
FIELD_MESSAGE |
context| Constructor and Description |
|---|
MessageJsonProvider() |
| Modifier and Type | Method and Description |
|---|---|
String |
getMessageSplitRegex()
Write the message as a JSON array by splitting the message text using the specified regex.
|
void |
setFieldNames(LogstashFieldNames fieldNames) |
void |
setMessageSplitRegex(String messageSplitRegex)
Write the message as a JSON array by splitting the message text using the specified regex.
|
void |
writeTo(JsonGenerator generator,
ILoggingEvent event)
Writes information about the event,
to the given generator.
|
getFieldName, setFieldNameisStarted, prepareForDeferredProcessing, start, stopaddError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContextpublic static final String FIELD_MESSAGE
public void writeTo(JsonGenerator generator, ILoggingEvent event) throws IOException
JsonProviderwriteTo in interface JsonProvider<ILoggingEvent>IOExceptionpublic void setFieldNames(LogstashFieldNames fieldNames)
setFieldNames in interface FieldNamesAware<LogstashFieldNames>public String getMessageSplitRegex()
public void setMessageSplitRegex(String messageSplitRegex)
The allowed values are:
For example, if this parameter is set to the regex #+, then the logging statement:
log.info("First line##Second line###Third line")
will produce:
{
...
"message": [
"First line",
"Second line",
"Third line"
],
...
}
messageSplitRegex - The regex used to split the message textCopyright © 2020. All rights reserved.