|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tivoli.twg.libs.TWGOpSysEvent
Native class for defining optional interfaces for logging JVM events to operating system specific event logs. This class will always log the events to an application-specific event file (which is cleared when the application is started again), but can also log events to operating system specific logs through a JNI of several methods). If the JNI methods are not found, the class will just add the events to the applications event file. The JNI methods are not required for all platforms.
Constructor Summary | |
---|---|
TWGOpSysEvent()
|
Method Summary | |
---|---|
static void |
dumpJVMMonitors()
Dump monitor state to stderr : uses JVM-specific functions, if available, otherwise do nothing |
static void |
dumpJVMThreads()
Dump thread state to stderr : uses JVM-specific functions, if available, otherwise just enumerates threads |
static java.lang.String |
getAppVersion()
Get version string appended to application name in error log entries |
static void |
logApplicationError(java.lang.String app,
int errcode,
java.lang.String errmsg)
Primary method for logging application error codes |
static void |
logApplicationError(java.lang.String app,
int errcode,
java.lang.String errmsg,
java.lang.Throwable excpt)
Primary method for logging application error codes |
static void |
logUnhandledException(java.lang.String app,
java.lang.Thread thrd,
java.lang.Throwable excpt)
Primary method for logging unhandled exceptions as errors |
static void |
main(java.lang.String[] args)
Command line interface for testing |
static void |
nativeDumpJVMMonitors()
Dump monitor state to stderr : uses JVM-specific functions, if available, otherwise do nothing |
static void |
nativeDumpJVMThreads()
Dump thread state to stderr : uses JVM-specific functions, if available, otherwise just enumerates threads |
static void |
setAppVersion(java.lang.String verstr)
Set version string appended to application name in error log entries |
static void |
setErrorHandler(TWGErrorHandler eh)
Set error handler |
static void |
setLogDirectory(java.lang.String logdir)
Set output directory for error logs |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TWGOpSysEvent()
Method Detail |
public static void logUnhandledException(java.lang.String app, java.lang.Thread thrd, java.lang.Throwable excpt)
app
- - application namethrd
- - thread throwing exceptionexcpt
- - exception thrownpublic static void logApplicationError(java.lang.String app, int errcode, java.lang.String errmsg)
app
- - application nameerrcode
- - error codeerrmsg
- - error messagepublic static void logApplicationError(java.lang.String app, int errcode, java.lang.String errmsg, java.lang.Throwable excpt)
app
- - application nameerrcode
- - error codeerrmsg
- - error messageexcpt
- - exceptionpublic static void dumpJVMThreads()
public static void nativeDumpJVMThreads()
public static void dumpJVMMonitors()
public static void nativeDumpJVMMonitors()
public static void setLogDirectory(java.lang.String logdir)
logdir
- - log directorypublic static void setAppVersion(java.lang.String verstr)
verstr
- version string to set (or null to set default)public static java.lang.String getAppVersion()
public static void main(java.lang.String[] args)
public static void setErrorHandler(TWGErrorHandler eh)
eh
- implementor of the TWGErrorHandler interface to set
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |