Class Log4j1SyslogLayout

    • Field Detail

      • localHostname

        private static final java.lang.String localHostname
        Host name used to identify messages from this appender.
      • facility

        private final Facility facility
      • facilityPrinting

        private final boolean facilityPrinting
      • header

        private final boolean header
      • dateFormatOptions

        private static final java.lang.String[] dateFormatOptions
        Date format used if header = true.
    • Constructor Detail

      • Log4j1SyslogLayout

        private Log4j1SyslogLayout​(Facility facility,
                                   boolean facilityPrinting,
                                   boolean header,
                                   StringLayout messageLayout,
                                   java.nio.charset.Charset charset)
    • Method Detail

      • toSerializable

        public java.lang.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 java.util.Map<java.lang.String,​java.lang.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<java.lang.String>
        Overrides:
        getContentFormat in class AbstractLayout<java.lang.String>
        Returns:
        Map of content format keys supporting SyslogLayout