org.apache.log.format
Class SyslogFormatter
org.apache.log.format.SyslogFormatter
- All Implemented Interfaces:
- Formatter
- public class SyslogFormatter
- implements Formatter
A formatter that serializes in the format originally
used by BSD syslog daemon.
- Author:
- Peter Donald
Constructor Summary |
SyslogFormatter()
Constructor that assumes FACILITY_USER. |
SyslogFormatter(int facility)
Constructor so that you can associate facility with formatter. |
SyslogFormatter(int facility,
boolean showFacilityBanner)
Constructor allowing setting of facility and whether to show banner. |
PRIORITY_DEBUG
public static final int PRIORITY_DEBUG
PRIORITY_INFO
public static final int PRIORITY_INFO
PRIORITY_NOTICE
public static final int PRIORITY_NOTICE
PRIORITY_WARNING
public static final int PRIORITY_WARNING
PRIORITY_ERR
public static final int PRIORITY_ERR
PRIORITY_CRIT
public static final int PRIORITY_CRIT
PRIORITY_ALERT
public static final int PRIORITY_ALERT
PRIORITY_EMERG
public static final int PRIORITY_EMERG
FACILITY_KERN
public static final int FACILITY_KERN
FACILITY_USER
public static final int FACILITY_USER
FACILITY_MAIL
public static final int FACILITY_MAIL
FACILITY_DAEMON
public static final int FACILITY_DAEMON
FACILITY_AUTH
public static final int FACILITY_AUTH
FACILITY_SYSLOG
public static final int FACILITY_SYSLOG
FACILITY_LPR
public static final int FACILITY_LPR
FACILITY_NEWS
public static final int FACILITY_NEWS
FACILITY_UUCP
public static final int FACILITY_UUCP
FACILITY_CRON
public static final int FACILITY_CRON
FACILITY_AUTHPRIV
public static final int FACILITY_AUTHPRIV
FACILITY_FTP
public static final int FACILITY_FTP
FACILITY_LOCAL0
public static final int FACILITY_LOCAL0
FACILITY_LOCAL1
public static final int FACILITY_LOCAL1
FACILITY_LOCAL2
public static final int FACILITY_LOCAL2
FACILITY_LOCAL3
public static final int FACILITY_LOCAL3
FACILITY_LOCAL4
public static final int FACILITY_LOCAL4
FACILITY_LOCAL5
public static final int FACILITY_LOCAL5
FACILITY_LOCAL6
public static final int FACILITY_LOCAL6
FACILITY_LOCAL7
public static final int FACILITY_LOCAL7
FACILITY_DESCRIPTIONS
protected static final String[] FACILITY_DESCRIPTIONS
SyslogFormatter
public SyslogFormatter()
- Constructor that assumes FACILITY_USER.
SyslogFormatter
public SyslogFormatter(int facility)
- Constructor so that you can associate facility with formatter.
- Parameters:
facility
- the facility constant
SyslogFormatter
public SyslogFormatter(int facility,
boolean showFacilityBanner)
- Constructor allowing setting of facility and whether to show banner.
- Parameters:
facility
- the facility code.showFacilityBanner
- true if facility banner should be shown
format
public String format(LogEvent event)
- Format log event into syslog string.
- Specified by:
format
in interface Formatter
- Parameters:
event
- the event- Returns:
- the formatted string
getFacilityDescription
protected String getFacilityDescription(int facility)
- Retrieve description for facility.
- Parameters:
facility
- the facility code- Returns:
- the facility description
getSyslogFacility
protected int getSyslogFacility(LogEvent event)
- Get facility associated with event.
Default implementation returns facility set in constructor.
- Parameters:
event
- the log event- Returns:
- the facility code
getSyslogPriority
protected int getSyslogPriority(LogEvent event)
- Get syslog priority code for LogEvent.
This is done by translating LogKit priority to syslog priority.
- Parameters:
event
- the log event- Returns:
- the priority code
Copyright © 2001 Apache Jakarta Project. All Rights Reserved.