Class Log4j1SyslogLayout

All Implemented Interfaces:
LocationAware, Layout<String>, Encoder<LogEvent>, StringLayout

@Plugin(name="Log4j1SyslogLayout", category="Core", elementType="layout", printObject=true) public final class Log4j1SyslogLayout extends AbstractStringLayout
Port of the layout used by SyslogAppender in Log4j 1.x. Provided for compatibility with existing Log4j 1 configurations. Originally developed by Ceki Gülcü and Anders Kristensen.
  • Method Details

    • newBuilder

      @PluginBuilderFactory public static <B extends Log4j1SyslogLayout.Builder<B>> B newBuilder()
    • toSerializable

      public String toSerializable(LogEvent event)
      Formats a LogEvent in conformance with the BSD Log record format.
      Parameters:
      event - The LogEvent
      Returns:
      the event formatted as a String.
    • getContentFormat

      public Map<String,String> getContentFormat()
      Gets this SyslogLayout's content format. Specified by:
      • Key: "structured" Value: "false"
      • Key: "dateFormat" Value: "MMM dd HH:mm:ss"
      • Key: "format" Value: "<LEVEL>TIMESTAMP PROP(HOSTNAME) MESSAGE"
      • Key: "formatType" Value: "logfilepatternreceiver" (format uses the keywords supported by LogFilePatternReceiver)
      Specified by:
      getContentFormat in interface Layout<String>
      Overrides:
      getContentFormat in class AbstractLayout<String>
      Returns:
      Map of content format keys supporting SyslogLayout