org.apache.log.format
public class SyslogFormatter extends Object implements Formatter
Field Summary | |
---|---|
static int | FACILITY_AUTH |
static int | FACILITY_AUTHPRIV |
static int | FACILITY_CRON |
static int | FACILITY_DAEMON |
protected static String[] | FACILITY_DESCRIPTIONS |
static int | FACILITY_FTP |
static int | FACILITY_KERN |
static int | FACILITY_LOCAL0 |
static int | FACILITY_LOCAL1 |
static int | FACILITY_LOCAL2 |
static int | FACILITY_LOCAL3 |
static int | FACILITY_LOCAL4 |
static int | FACILITY_LOCAL5 |
static int | FACILITY_LOCAL6 |
static int | FACILITY_LOCAL7 |
static int | FACILITY_LPR |
static int | FACILITY_MAIL |
static int | FACILITY_NEWS |
static int | FACILITY_SYSLOG |
static int | FACILITY_USER |
static int | FACILITY_UUCP |
int | m_facility |
boolean | m_showFacilityBanner |
static int | PRIORITY_ALERT |
static int | PRIORITY_CRIT |
static int | PRIORITY_DEBUG |
static int | PRIORITY_EMERG |
static int | PRIORITY_ERR |
static int | PRIORITY_INFO |
static int | PRIORITY_NOTICE |
static int | PRIORITY_WARNING |
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.
|
Method Summary | |
---|---|
String | format(LogEvent event)
Format log event into syslog string.
|
protected String | getFacilityDescription(int facility)
Retrieve description for facility.
|
protected int | getSyslogFacility(LogEvent event)
Get facility associated with event.
|
protected int | getSyslogPriority(LogEvent event)
Get syslog priority code for LogEvent.
|
Parameters: facility the facility constant
Parameters: facility the facility code. showFacilityBanner true if facility banner should be shown
Parameters: event the event
Returns: the formatted string
Parameters: facility the facility code
Returns: the facility description
Parameters: event the log event
Returns: the facility code
Parameters: event the log event
Returns: the priority code