@Plugin(name="Log4j1XmlLayout", category="Core", elementType="layout", printObject=true) public final class Log4j1XmlLayout extends AbstractStringLayout
AbstractStringLayout.Builder<B extends AbstractStringLayout.Builder<B>>, AbstractStringLayout.Serializer, AbstractStringLayout.Serializer2
DEFAULT_STRING_BUILDER_SIZE, MAX_STRING_BUILDER_SIZE
configuration, eventCount, footer, header, LOGGER
ELEMENT_TYPE
Modifier and Type | Method and Description |
---|---|
static Log4j1XmlLayout |
createLayout(boolean locationInfo,
boolean properties) |
void |
encode(LogEvent event,
ByteBufferDestination destination)
Encodes the specified source LogEvent to some binary representation and writes the result to the specified
destination.
|
boolean |
isLocationInfo() |
boolean |
isProperties() |
String |
toSerializable(LogEvent event)
Formats the event as an Object that can be serialized.
|
getBytes, getCharset, getContentType, getFooter, getFooterSerializer, getHeader, getHeaderSerializer, getStringBuilder, getStringBuilderEncoder, serializeToBytes, serializeToString, toByteArray, trimToMaxSize
getConfiguration, getContentFormat, markEvent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContentFormat
@PluginFactory public static Log4j1XmlLayout createLayout(@PluginAttribute(value="locationInfo") boolean locationInfo, @PluginAttribute(value="properties") boolean properties)
public boolean isLocationInfo()
public boolean isProperties()
public void encode(LogEvent event, ByteBufferDestination destination)
AbstractLayout
The default implementation of this method delegates to the Layout.toByteArray(LogEvent)
method which allocates
temporary objects.
Subclasses can override this method to provide a garbage-free implementation. For text-based layouts,
AbstractStringLayout
provides various convenience methods to help with this:
@Plugin(name = "MyLayout", category = Node.CATEGORY, elementType = Layout.ELEMENT_TYPE, printObject = true) public final class MyLayout extends AbstractStringLayout {
encode
in interface Encoder<LogEvent>
encode
in class AbstractLayout<String>
event
- the LogEvent to encode.destination
- holds the ByteBuffer to write into.AbstractStringLayout.getStringBuilder()
,
AbstractStringLayout.getStringBuilderEncoder()
Copyright © 1999-2017 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.