Class Log4j1XmlLayout

    • Field Detail

      • EOL

        private static final java.lang.String EOL
        We yield to the \r\n heresy.
        See Also:
        Constant Field Values
      • locationInfo

        private final boolean locationInfo
      • properties

        private final boolean properties
    • Constructor Detail

      • Log4j1XmlLayout

        private Log4j1XmlLayout​(boolean locationInfo,
                                boolean properties)
    • 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<java.lang.String>
        Parameters:
        event - the LogEvent to encode.
        destination - holds the ByteBuffer to write into.
        See Also:
        AbstractStringLayout.getStringBuilder(), AbstractStringLayout.getStringBuilderEncoder()
      • toSerializable

        public java.lang.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.
      • formatTo

        private void formatTo​(LogEvent event,
                              java.lang.StringBuilder buf)