|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.access.EventLog
The EventLog class is an implementation of Log which logs exceptions and messages to the specified file or PrintStream.
Here is an example use of EventLog, which will write a timestamp and message to the specified file:
EventLog myLog = new EventLog("myFile"); myLog.log("You have successfully written to my log file."); myLog.log("Another log message.");
Each successive message will be appended to the previous messages in the log.
Here is what the log file will look like:
Mon Jan 03 09:00:00 CST 2000 Yout have successfully written to my log file.
Mon Jan 03 09:00:01 CST 2000 Another log message.
Constructor Summary | |
EventLog()
Constructs a default EventLog object. |
|
EventLog(java.io.OutputStream stream)
Constructs an EventLog object with the specified OutputStream. |
|
EventLog(java.io.PrintWriter out)
Constructs an EventLog object with the specified PrintWriter. |
|
EventLog(java.lang.String pathname)
Constructs an EventLog object with the specified file pathname. |
Method Summary | |
void |
log(java.lang.String msg)
Logs a message to the event log. |
void |
log(java.lang.String msg,
java.lang.Throwable exception)
Logs an exception and message to the event log. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EventLog()
public EventLog(java.lang.String pathname) throws java.io.IOException
pathname
- The file pathname.java.io.IOException
- If an error occurs while accessing the file.public EventLog(java.io.OutputStream stream) throws java.io.IOException
stream
- The log OutputStream.java.io.IOException
- If an error occurs while accessing the stream.public EventLog(java.io.PrintWriter out)
out
- The PrintWriter.Method Detail |
public void log(java.lang.String msg)
log
in interface Log
msg
- The message to log.public void log(java.lang.String msg, java.lang.Throwable exception)
log
in interface Log
msg
- The message to log.exception
- The exception to log.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |