|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.opnav.Monitor
A utility class which provides centralized activity logging and
error logging. Monitor
is re-implemented on
each UI platform so that Operations Navigator components needn't concern
themselves with the details of how to log errors, exceptions,
and activity traces.
During development, error messages and exceptions are logged to the Operations Navigator Java console. The console is enabled by setting the following Windows registry entry:
HKEY_CURRENT_USER Software IBM Client Access CurrentVersion AS400 Operations Navigator Trace "JETRACE"="ON"The console may also be enabled from within Java code by calling
setConsoleEnabled
.
In production, error messages and exceptions may be redirected to a
specific log file or OutputStream
.
Monitor
is also the repository for information passed
across the JNI interface from Operations Navigator. For example,
the installation path for Operations Navigator Java native services is maintained
by this object.
UIServices
Field Summary | |
static java.lang.String |
SHARED_LOG_FILE_NAME
The name of the shared service log file to which Operations Navigator components should log information for use in problem determination. |
Method Summary | |
static java.lang.String |
getInstallPath()
Returns the install path. |
static java.lang.String |
getLogFileName()
Returns the log file name. |
static java.io.OutputStream |
getLogStream()
Returns the log stream. |
static boolean |
isConsoleEnabled()
Determines whether the Operations Navigator Java console is enabled. |
static void |
logError(java.lang.Object errorData)
Logs an error string to the current logging destination. |
static void |
logThrowable(java.lang.Throwable e)
Logs an exception to the current logging destination. |
static void |
setConsoleEnabled(boolean enabled)
Enables the Operations Navigator Java console. |
static void |
setConsoleTitle(java.lang.String consoleTitle)
Sets the title used for the Java console window. |
static void |
setInstallPath(java.lang.String installPath)
Sets the install path. |
static void |
setLogFileName(java.lang.String fileName)
Sets the log file name. |
static void |
setLogStream(java.io.OutputStream stream)
Sets the log stream. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static java.lang.String SHARED_LOG_FILE_NAME
Method Detail |
public static void setLogFileName(java.lang.String fileName) throws java.io.IOException
fileName
- the log file name. If null, output is written to the Java console
if it is enabled; otherwise output is suppressed.getLogFileName()
public static java.lang.String getLogFileName()
OutputStream
was specified on a call to setLogStream
.setLogFileName(java.lang.String)
,
setLogStream(java.io.OutputStream)
public static void setLogStream(java.io.OutputStream stream) throws java.io.IOException
OutputStream
used by the
plugin itself for logging errors.stream
- the OutputStream
to which error data should be sent.
If null, output goes to the Java console if it is enabled; otherwise output is suppressed.getLogStream()
public static java.io.OutputStream getLogStream()
OutputStream
to which error data is being sentsetLogStream(java.io.OutputStream)
public static void logError(java.lang.Object errorData)
errorData
- the data to be loggedpublic static void logThrowable(java.lang.Throwable e)
e
- the exception to be logged. The message will include the
exception class name, the exception message if any, and a printout of
the call stack.public static void setConsoleEnabled(boolean enabled)
stdout
and stderr
to the console window. In addition, the output of logError
and logThrowable
are written to the console if no log stream
has been set.enabled
- indicates whether the Java console should be enabled.isConsoleEnabled()
,
setLogFileName(java.lang.String)
,
setLogStream(java.io.OutputStream)
public static boolean isConsoleEnabled()
setConsoleEnabled(boolean)
public static java.lang.String getInstallPath()
UIServices
.UIServices
public static void setInstallPath(java.lang.String installPath)
installPath
- the install path for Operations Navigator native services.UIServices
public static void setConsoleTitle(java.lang.String consoleTitle)
consoleTitle
- the title to be used for the Operations Navigator Java console window.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |