@Plugin(name="JsonLog4j2Layout",
category="Core",
elementType="layout",
printObject=true)
public class JsonLog4j2Layout
extends org.apache.logging.log4j.core.layout.AbstractStringLayout
Context
class.org.apache.logging.log4j.core.layout.AbstractStringLayout.Builder<B extends org.apache.logging.log4j.core.layout.AbstractStringLayout.Builder<B>>, org.apache.logging.log4j.core.layout.AbstractStringLayout.Serializer, org.apache.logging.log4j.core.layout.AbstractStringLayout.Serializer2
DEFAULT_STRING_BUILDER_SIZE, MAX_STRING_BUILDER_SIZE
Modifier | Constructor and Description |
---|---|
protected |
JsonLog4j2Layout() |
protected |
JsonLog4j2Layout(Charset charset,
String dateFormat) |
Modifier and Type | Method and Description |
---|---|
static JsonLog4j2Layout |
createLayout(Charset charset,
String dateFormat) |
String |
toSerializable(org.apache.logging.log4j.core.LogEvent event)
Formats a
LogEvent . |
getBytes, getCharset, getContentType, getFooter, getFooterSerializer, getHeader, getHeaderSerializer, getStringBuilder, getStringBuilderEncoder, requiresLocation, serializeToBytes, serializeToString, toByteArray, trimToMaxSize
encode, getConfiguration, getContentFormat, markEvent
public String toSerializable(org.apache.logging.log4j.core.LogEvent event)
LogEvent
.event
- The LogEvent.@PluginFactory public static JsonLog4j2Layout createLayout(@PluginAttribute(value="charset",defaultString="UTF-8") Charset charset, @PluginAttribute(value="dateFormat",defaultString="yyyy-MM-dd HH:mm:ss.SSS") String dateFormat)
Copyright © 2020 JavaLite. All rights reserved.