|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSysLogger
public class SysLogger
The class SysLogger provides methods for logging messages of differing priorities to the syslog.
Field Summary | |
---|---|
private java.lang.String |
identification
|
private java.net.InetAddress |
in
|
private static java.lang.String |
ipAddress
|
private boolean |
logOpened
|
private java.lang.String |
logOptions
|
private java.lang.String |
message
|
private java.lang.String |
priority
|
private boolean |
sendOkay
|
private java.lang.String |
severity
|
Constructor Summary | |
---|---|
SysLogger()
Contructor |
Method Summary | |
---|---|
void |
closeLog()
Stop the logging process |
boolean |
isOpen()
Checks if the Log is open |
void |
openLog()
Starts the logging process |
void |
openLog(java.lang.String ident,
java.lang.String logopt)
Starts the logging process |
private void |
sendMessage(java.lang.String identity,
java.lang.String logSev,
java.lang.String logMsg)
Sends message to the specified syslogd server |
private java.lang.String |
setLocalHostAddress()
Sets LocalHost Address |
void |
setSysLogger()
Sets the IP address of the syslogd server |
void |
setSysLogger(java.lang.String ip)
Sets the IP address of the syslogd server |
java.lang.String |
showSysLogger()
Shows the IP address of the syslogd server |
void |
sysLog(java.lang.String sev,
java.lang.String msg)
Log the message provided to the specific syslogd server after opening the log at the specified severity level. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.lang.String ipAddress
private java.lang.String identification
private java.lang.String logOptions
private java.lang.String severity
private java.lang.String priority
private java.lang.String message
private boolean logOpened
private boolean sendOkay
private java.net.InetAddress in
Constructor Detail |
---|
public SysLogger()
none
- Method Detail |
---|
private java.lang.String setLocalHostAddress()
none
-
public boolean isOpen()
none
-
public void setSysLogger()
If the client doesn't specify the syslogd's IP address, localhost is assumed to be the syslogd server.
none
- public void setSysLogger(java.lang.String ip)
If the client doesn't specify the syslogd's IP address, localhost is assumed to be the syslogd server.
ip
- IP address of the syslogd serverpublic java.lang.String showSysLogger()
If the client doesn't specify the syslogd's IP address, by calling setSysLogger(), localhost's IP address is returned
none
-
public void openLog()
Just by calling openLog() with no arguments, starts logging without identification prefix to the messages. IP address of client machine is logged wherever supported. "Java App" is prefixed to all the messages logged.
none
- public void openLog(java.lang.String ident, java.lang.String logopt)
Logging process starts by calling openLog() and String ident is used to prefix all the logged messages.
ident
- This is used as prefix to all the messages sent
to the syslogdlogopt
- Specifies the logging options to be used.public void closeLog()
No more logging will occur after log has been closed.
none
- return nonepublic void sysLog(java.lang.String sev, java.lang.String msg) throws java.io.IOException, UnOpenedLogException
This method checks to see if the log has been previously opened, and then sets the messages severity level as specified.
sev
- Defines the severity of the messagemsg
- Message to be logged
UnOpenedLogException
- If log has not been previously openend.
java.io.IOException
private void sendMessage(java.lang.String identity, java.lang.String logSev, java.lang.String logMsg) throws UnOpenedLogException
Not directky called by the application developer
UnOpenedLogException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |