Class Log4j1XmlLayout

    • Method Detail

      • isLocationInfo

        public boolean isLocationInfo()
      • isProperties

        public boolean isProperties()
      • encode

        public void encode​(LogEvent event,
                           ByteBufferDestination destination)
        Description copied from class: AbstractLayout
        Encodes the specified source LogEvent to some binary representation and writes the result to the specified destination.

        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 {
        
        Specified by:
        encode in interface Encoder<LogEvent>
        Overrides:
        encode in class AbstractLayout<String>
        Parameters:
        event - the LogEvent to encode.
        destination - holds the ByteBuffer to write into.
        See Also:
        AbstractStringLayout.getStringBuilder(), AbstractStringLayout.getStringBuilderEncoder()
      • toSerializable

        public String toSerializable​(LogEvent event)
        Description copied from interface: Layout
        Formats the event as an Object that can be serialized.
        Parameters:
        event - The Logging Event.
        Returns:
        The formatted event.