Node Director
|
The Syslog class implements the UNIX syslog protocol allowing Java to log messages to a specified UNIX host. More...
Public Member Functions | |
Syslog (String name, int flags) throws SyslogException | |
Creates a Syslog object instance, targeted for the UNIX host with the hostname 'hostname' on the syslog port 'port'. | |
Syslog (String hostname, int port, String name, int flags) throws SyslogException | |
Creates a Syslog object instance, targeted for the UNIX host with the hostname 'hostname' on the syslog port 'port'. | |
void | syslog (int fac, int pri, String msg) throws SyslogException |
Use this method to log your syslog messages. | |
void | syslog (InetAddress addr, int fac, int pri, String msg) throws SyslogException |
Use this method to log your syslog messages. | |
void | syslog (String hostname, int fac, int pri, String msg) throws SyslogException |
Use this method to log your syslog messages. | |
void | syslog (String hostname, int port, int fac, int pri, String msg) throws SyslogException |
Use this method to log your syslog messages. | |
void | syslog (InetAddress addr, int port, int fac, int pri, String msg) throws SyslogException |
Use this method to log your syslog messages. |
Static Public Member Functions | |
static void | open (String hostname, String name, int flags) throws SyslogException |
Binds the Syslog class to a specified host for further logging. | |
static void | log (int fac, int lvl, String msg) throws SyslogException |
Performs a syslog to the currently bound syslog host. | |
static void | close () |
Unbinds the current syslog host. |
The Syslog class implements the UNIX syslog protocol allowing Java to log messages to a specified UNIX host.
Care has been taken to preserve as much of the UNIX implementation as possible.
To use Syslog, simply create an instance, and use the Syslog() method to log your message. The class provides all the expected syslog constants. For example, LOG_ERR is Syslog.LOG_ERR.
Written: Tim Endres
Version: 1.2 - July 27, 1998
Version: 1.0 - August 14, 1996
Source: Syslog.java
com.ice.syslog.Syslog.Syslog | ( | String | name, |
int | flags | ||
) | throws SyslogException |
Creates a Syslog object instance, targeted for the UNIX host with the hostname 'hostname' on the syslog port 'port'.
The only flags recognized are 'LOG_PERROR', which will log the message to Java's 'System.err'.
References com.ice.syslog.SyslogDefs.DEFAULT_PORT.
Referenced by com.ice.syslog.Syslog.open().
com.ice.syslog.Syslog.Syslog | ( | String | hostname, |
int | port, | ||
String | name, | ||
int | flags | ||
) | throws SyslogException |
Creates a Syslog object instance, targeted for the UNIX host with the hostname 'hostname' on the syslog port 'port'.
The only flags recognized are 'LOG_PERROR', which will log the message to Java's 'System.err'.
|
static |
Unbinds the current syslog host.
|
static |
Performs a syslog to the currently bound syslog host.
References com.ice.syslog.Syslog.syslog().
|
static |
Binds the Syslog class to a specified host for further logging.
See the Syslog constructor for details on the parameters.
References com.ice.syslog.SyslogDefs.DEFAULT_PORT, and com.ice.syslog.Syslog.Syslog().
void com.ice.syslog.Syslog.syslog | ( | int | fac, |
int | pri, | ||
String | msg | ||
) | throws SyslogException |
Use this method to log your syslog messages.
The facility and level are the same as their UNIX counterparts, and the Syslog class provides constants for these fields. The msg is what is actually logged.
Referenced by com.ice.syslog.Syslog.log(), com.ice.syslog.Syslog.syslog(), and sfi.director.util.SyslogThread.work().
void com.ice.syslog.Syslog.syslog | ( | InetAddress | addr, |
int | fac, | ||
int | pri, | ||
String | msg | ||
) | throws SyslogException |
Use this method to log your syslog messages.
The facility and level are the same as their UNIX counterparts, and the Syslog class provides constants for these fields. The msg is what is actually logged.
References com.ice.syslog.Syslog.syslog().
void com.ice.syslog.Syslog.syslog | ( | String | hostname, |
int | fac, | ||
int | pri, | ||
String | msg | ||
) | throws SyslogException |
Use this method to log your syslog messages.
The facility and level are the same as their UNIX counterparts, and the Syslog class provides constants for these fields. The msg is what is actually logged.
References com.ice.syslog.Syslog.syslog().
void com.ice.syslog.Syslog.syslog | ( | String | hostname, |
int | port, | ||
int | fac, | ||
int | pri, | ||
String | msg | ||
) | throws SyslogException |
Use this method to log your syslog messages.
The facility and level are the same as their UNIX counterparts, and the Syslog class provides constants for these fields. The msg is what is actually logged.
References com.ice.syslog.Syslog.syslog().
void com.ice.syslog.Syslog.syslog | ( | InetAddress | addr, |
int | port, | ||
int | fac, | ||
int | pri, | ||
String | msg | ||
) | throws SyslogException |
Use this method to log your syslog messages.
The facility and level are the same as their UNIX counterparts, and the Syslog class provides constants for these fields. The msg is what is actually logged.
References com.ice.syslog.SyslogDefs.computeCode(), and com.ice.syslog.SyslogDefs.LOG_PERROR.