public class WindowsNTEventLog extends Object
This implementation writes "all" events to the Windows NT event log using a DLL function using JNI interface.
Modifier and Type | Field and Description |
---|---|
static int |
EVENTCLASS_CRITICAL
The event class for critical events (2).
|
static int |
EVENTCLASS_ERROR
The event class for errors (1).
|
static int |
EVENTCLASS_INFORMATIONAL
The event class for informational events (4).
|
static int |
EVENTCLASS_WARNING
The event class for warnings (3).
|
Constructor and Description |
---|
WindowsNTEventLog() |
Modifier and Type | Method and Description |
---|---|
static String[] |
checkNTParams(String[] args)
Checks if the options "-ntservice" and/or "-nteventlog" are specified.
|
static void |
logEvent(String originator,
int eventClass,
String msg)
Logs an event in the Event Log.
|
static void |
logEvent(String originator,
String msg)
Logs an event in the Event Log.
|
protected static void |
logEvent0(String originator,
int eventClass,
String msg)
The native function that logs an event.
|
static boolean |
setIgnoreLogoff()
Static method call that allows handling of Logoff event when
running as a Windows NT Service.
|
protected static boolean |
setIgnoreLogoff0()
Static method call that allows handling of Logoff event when
running as a Windows NT Service.
|
static boolean |
useEventLog()
Checks if the Event Log should be used.
|
public static final int EVENTCLASS_ERROR
public static final int EVENTCLASS_CRITICAL
public static final int EVENTCLASS_WARNING
public static final int EVENTCLASS_INFORMATIONAL
public static boolean useEventLog()
checkNTParams
has been done and the arguments
contained the option "-nteventlog".public static boolean setIgnoreLogoff()
protected static boolean setIgnoreLogoff0()
public static String[] checkNTParams(String[] args)
setIgnoreLogoff
is performed for
"-ntservice". The return array from this function removes the
option(s) "/ntservice", "-ntservice", "/nteventlog" or "-nteventlog".public static void logEvent(String originator, String msg)
Note that the methods in this interface can be called from different
threads, so the implementing code may have to be e.g. synchronized
.
public static void logEvent(String originator, int eventClass, String msg)
Note that the methods in this interface can be called from different
threads, so the implementing code may have to be e.g. synchronized
.
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.