|
Log4j 0.9.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.log4j.AppenderSkeleton | +--org.log4j.net.SyslogAppender
Use SyslogAppender to send log messages to a remote syslog daemon.
Field Summary | |
protected static int |
FACILITY_OI
|
static String |
FACILITY_OPTION
A string constant used in naming the option for setting facility type. |
static String |
FACILITY_PRINTING_OPTION
A string constant used in naming the option for setting whether the facility name is printed or not. |
static int |
LOG_AUTH
security/authorization messages |
static int |
LOG_AUTHPRIV
security/authorization messages (private) |
static int |
LOG_CRON
clock daemon |
static int |
LOG_DAEMON
System daemons |
static int |
LOG_FTP
ftp daemon |
static int |
LOG_KERN
Kernel messages |
static int |
LOG_LOCAL0
reserved for local use |
static int |
LOG_LOCAL1
reserved for local use |
static int |
LOG_LOCAL2
reserved for local use |
static int |
LOG_LOCAL3
reserved for local use |
static int |
LOG_LOCAL4
reserved for local use |
static int |
LOG_LOCAL5
reserved for local use |
static int |
LOG_LOCAL6
reserved for local use |
static int |
LOG_LOCAL7
reserved for local use |
static int |
LOG_LPR
line printer subsystem |
static int |
LOG_MAIL
Mail system |
static int |
LOG_NEWS
network news subsystem |
static int |
LOG_SYSLOG
messages generated internally by syslogd |
static int |
LOG_USER
Random user-level messages |
static int |
LOG_UUCP
UUCP subsystem |
protected static int |
SYSLOG_HOST_OI
|
static String |
SYSLOG_HOST_OPTION
A string constant used in naming the option for setting the the syslog server. |
Fields inherited from class org.log4j.AppenderSkeleton |
closed, errorHandler, headFilter, layout, name, tailFilter, threshold, THRESHOLD_OPTION |
Constructor Summary | |
SyslogAppender()
|
|
SyslogAppender(Layout layout,
int syslogFacility)
|
|
SyslogAppender(Layout layout,
String syslogHost,
int syslogFacility)
|
Method Summary | |
void |
activateOptions()
This method returns immediately as options are activated when they are set. |
void |
append(LoggingEvent event)
Subclasses of AppenderSkeleton should imlement this
method to perform actual logging. |
void |
close()
Release any resources held by this SyslogAppender. |
String[] |
getOptionStrings()
Retuns the option names for this component, namely the string array consisting of { SYSLOG_HOST_OPTION , FACILITY_OPTION , FACILITY_PRINTING_OPTION }. |
boolean |
requiresLayout()
The SyslogAppender requires a layout. |
void |
setFacility(String facilityName)
Set the syslog facility. |
void |
setOption(String option,
String value)
Set SyslogAppender specific parameters. |
void |
setSyslogHost(String syslogHost)
|
Methods inherited from class org.log4j.AppenderSkeleton |
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFirstFilter, getName, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LOG_KERN
public static final int LOG_USER
public static final int LOG_MAIL
public static final int LOG_DAEMON
public static final int LOG_AUTH
public static final int LOG_SYSLOG
public static final int LOG_LPR
public static final int LOG_NEWS
public static final int LOG_UUCP
public static final int LOG_CRON
public static final int LOG_AUTHPRIV
public static final int LOG_FTP
public static final int LOG_LOCAL0
public static final int LOG_LOCAL1
public static final int LOG_LOCAL2
public static final int LOG_LOCAL3
public static final int LOG_LOCAL4
public static final int LOG_LOCAL5
public static final int LOG_LOCAL6
public static final int LOG_LOCAL7
public static final String SYSLOG_HOST_OPTION
public static final String FACILITY_OPTION
public static final String FACILITY_PRINTING_OPTION
protected static final int SYSLOG_HOST_OI
protected static final int FACILITY_OI
Constructor Detail |
public SyslogAppender()
public SyslogAppender(Layout layout, int syslogFacility)
public SyslogAppender(Layout layout, String syslogHost, int syslogFacility)
Method Detail |
public void close()
public void append(LoggingEvent event)
AppenderSkeleton
AppenderSkeleton
should imlement this
method to perform actual logging. See also AppenderSkeleton.doAppend
method.append
in class AppenderSkeleton
public void activateOptions()
activateOptions
in class AppenderSkeleton
setOption(java.lang.String, java.lang.String)
public String[] getOptionStrings()
SYSLOG_HOST_OPTION
, FACILITY_OPTION
, FACILITY_PRINTING_OPTION
}.getOptionStrings
in class AppenderSkeleton
public boolean requiresLayout()
true
.public void setFacility(String facilityName)
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 setOption(String option, String value)
The recognized options are SyslogHost, Facility and
FacilityPrinting, i.e. the values of the string constants
SYSLOG_HOST_OPTION
, FACILITY_OPTION
and FACILITY_PRINTING_OPTION
respectively.
Acceptable values are in the set {KERN, USER, MAIL, DAEMON, AUTH, SYSLOG, LPR, NEWS, UUCP, CRON, AUTHPRIV, FTP LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7}.
setOption
in class AppenderSkeleton
public void setSyslogHost(String syslogHost)
|
Log4j 0.9.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |