org.apache.logging.log4j.core.layout
Class SyslogLayout

java.lang.Object
  extended by org.apache.logging.log4j.core.layout.LayoutBase<String>
      extended by org.apache.logging.log4j.core.layout.AbstractStringLayout
          extended by org.apache.logging.log4j.core.layout.SyslogLayout
All Implemented Interfaces:
Layout<String>

public class SyslogLayout
extends AbstractStringLayout

Formats a log event as a BSD Log record.


Field Summary
 
Fields inherited from class org.apache.logging.log4j.core.layout.LayoutBase
footer, header, LOGGER
 
Constructor Summary
protected SyslogLayout(Facility facility, boolean includeNL, Charset c)
           
 
Method Summary
static SyslogLayout createLayout(String facility, String includeNL, String charset)
          Create a SyslogLayout.
 String formatAs(LogEvent event)
          Formats a LogEvent in conformance with the log4j.dtd.
 
Methods inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout
format, getCharset
 
Methods inherited from class org.apache.logging.log4j.core.layout.LayoutBase
getFooter, getHeader, setFooter, setHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyslogLayout

protected SyslogLayout(Facility facility,
                       boolean includeNL,
                       Charset c)
Method Detail

formatAs

public String formatAs(LogEvent event)
Formats a LogEvent in conformance with the log4j.dtd.

Parameters:
event - The LogEvent
Returns:
the event formatted as a String.

createLayout

public static SyslogLayout createLayout(String facility,
                                        String includeNL,
                                        String charset)
Create a SyslogLayout.

Parameters:
facility - The Facility is used to try to classify the message.
includeNL - If true a newline will be appended to the result.
charset - The character set.
Returns:
A SyslogLayout.


Copyright © 1999-2012 Apache Software Foundation. All Rights Reserved.