Save This Page
Home » slf4j-1.5.5 » org.apache » log4j » net » [javadoc | source]
org.apache.log4j.net
public class: SyslogAppender [javadoc | source]
java.lang.Object
   org.apache.log4j.AppenderSkeleton
      org.apache.log4j.net.SyslogAppender

All Implemented Interfaces:
    OptionHandler, Appender

Use SyslogAppender to send log messages to a remote syslog daemon.
Field Summary
public static final  int LOG_KERN    Kernel messages 
public static final  int LOG_USER    Random user-level messages 
public static final  int LOG_MAIL    Mail system 
public static final  int LOG_DAEMON    System daemons 
public static final  int LOG_AUTH    security/authorization messages 
public static final  int LOG_SYSLOG    messages generated internally by syslogd 
public static final  int LOG_LPR    line printer subsystem 
public static final  int LOG_NEWS    network news subsystem 
public static final  int LOG_UUCP    UUCP subsystem 
public static final  int LOG_CRON    clock daemon 
public static final  int LOG_AUTHPRIV    security/authorization messages (private) 
public static final  int LOG_FTP    ftp daemon 
public static final  int LOG_LOCAL0    reserved for local use 
public static final  int LOG_LOCAL1    reserved for local use 
public static final  int LOG_LOCAL2    reserved for local use 
public static final  int LOG_LOCAL3    reserved for local use 
public static final  int LOG_LOCAL4    reserved for local use 
public static final  int LOG_LOCAL5    reserved for local use 
public static final  int LOG_LOCAL6    reserved for local use 
public static final  int LOG_LOCAL7    reserved for local use 
protected static final  int SYSLOG_HOST_OI     
protected static final  int FACILITY_OI     
static final  String TAB     
 int syslogFacility     
 String facilityStr     
 boolean facilityPrinting     
 SyslogQuietWriter sqw     
 String syslogHost     
Fields inherited from org.apache.log4j.AppenderSkeleton:
layout,  name,  threshold,  errorHandler,  headFilter,  tailFilter,  closed
Constructor:
 public SyslogAppender() 
 public SyslogAppender(Layout layout,
    int syslogFacility) 
 public SyslogAppender(Layout layout,
    String syslogHost,
    int syslogFacility) 
Method from org.apache.log4j.net.SyslogAppender Summary:
activateOptions,   append,   close,   getFacility,   getFacility,   getFacilityPrinting,   getFacilityString,   getHeader,   getSyslogHost,   requiresLayout,   setFacility,   setFacilityPrinting,   setHeader,   setSyslogHost
Methods from org.apache.log4j.AppenderSkeleton:
activateOptions,   addFilter,   append,   clearFilters,   doAppend,   finalize,   getErrorHandler,   getFilter,   getFirstFilter,   getLayout,   getName,   getThreshold,   isAsSevereAsThreshold,   setErrorHandler,   setLayout,   setName,   setThreshold
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.log4j.net.SyslogAppender Detail:
 public  void activateOptions() 
    This method returns immediately as options are activated when they are set.
 public  void append(LoggingEvent event) 
 public synchronized  void close() 
    Release any resources held by this SyslogAppender.
 public String getFacility() 
    Returns the value of the Facility option.
 public static int getFacility(String facilityName) 
    Returns the integer value corresponding to the named syslog facility, or -1 if it couldn't be recognized.
 public boolean getFacilityPrinting() 
    Returns the value of the FacilityPrinting option.
 public static String getFacilityString(int syslogFacility) 
    Returns the specified syslog facility as a lower-case String, e.g. "kern", "user", etc.
 public final boolean getHeader() 
    If true, the appender will generate the HEADER part (that is, timestamp and host name) of the syslog packet. Default value is false for compatibility with existing behavior, however should be true unless there is a specific justification.
 public String getSyslogHost() 
    Returns the value of the SyslogHost option.
 public boolean requiresLayout() 
    The SyslogAppender requires a layout. Hence, this method returns true.
 public  void setFacility(String facilityName) 
    Set the syslog facility. This is the Facility option.

    The facilityName parameter must be one of the strings KERN, USER, MAIL, DAEMON, AUTH, SYSLOG, LPR, NEWS, UUCP, CRON, AUTHPRIV, FTP, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. Case is unimportant.

 public  void setFacilityPrinting(boolean on) 
    If the FacilityPrinting option is set to true, the printed message will include the facility name of the application. It is false by default.
 public final  void setHeader(boolean val) 
    Returns whether the appender produces the HEADER part (that is, timestamp and host name) of the syslog packet.
 public  void setSyslogHost(String syslogHost) 
    The SyslogHost option is the name of the the syslog host where log output should go. A non-default port can be specified by appending a colon and port number to a host name, an IPv4 address or an IPv6 address enclosed in square brackets. WARNING If the SyslogHost is not set, then this appender will fail.