Class SyslogLayout

    • Field Detail

      • NEWLINE_PATTERN

        public static final java.util.regex.Pattern NEWLINE_PATTERN
        Match newlines in a platform-independent manner.
    • Constructor Detail

      • SyslogLayout

        protected SyslogLayout​(Facility facility,
                               boolean includeNL,
                               java.lang.String escapeNL,
                               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
      • createLayout

        @Deprecated
        public static SyslogLayout createLayout​(Facility facility,
                                                boolean includeNewLine,
                                                java.lang.String escapeNL,
                                                java.nio.charset.Charset charset)
        Deprecated.
        Creates a SyslogLayout.
        Parameters:
        facility - The Facility is used to try to classify the message.
        includeNewLine - If true a newline will be appended to the result.
        escapeNL - Pattern to use for replacing newlines.
        charset - The character set.
        Returns:
        A SyslogLayout.
      • getFacility

        public Facility getFacility()
        Gets the facility.
        Returns:
        the facility