com.regexlab.j2e
Class EventLog

java.lang.Object
  extended by com.regexlab.j2e.EventLog

public class EventLog
extends java.lang.Object

This class implements an event log. It is based directly upon the Win32 event log APIs, RegisterEventSource, ReportEvent, and DeregisterEventSource.

For more information on implementing and using event logs, see the Win32 documentation

Copyright 2006 (c) RegExLab.com


Field Summary
static short AUDIT_FAILURE
          Indicates a failure audit event
static short AUDIT_SUCCESS
          Indicates a success audit event
static short ERROR
          Indicates an error event
static short INFORMATION
          Indicates an information event
static short SUCCESS
          Indicates a success event
static short WARNING
          Indicates a warning event
 
Constructor Summary
EventLog()
          Creates an EventLog object with app name
EventLog(java.lang.String source)
          Creates an EventLog object given the name of the source
EventLog(java.lang.String server, java.lang.String source)
          Creates an EventLog object given the name of the source and the name of the server.
 
Method Summary
 void reportEvent(short type, short cat, int id)
          Writes an entry at the end of the event log
 void reportEvent(short type, short cat, int id, java.lang.String msg)
          Writes an entry at the end of the event log, providing an associated string
 void reportEvent(short type, short cat, int id, java.lang.String[] msgs)
          Writes an entry at the end of the event log, providing associated strings
 void reportEvent(short type, short cat, int id, java.lang.String[] msgs, byte[] data)
          Writes an entry at the end of the event log, providing associated strings and binary data
 void reportEvent(short type, short cat, int id, java.lang.String msg, byte[] data)
          Writes an entry at the end of the event log, providing an associated string and binary data
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUCCESS

public static final short SUCCESS
Indicates a success event

See Also:
Constant Field Values

ERROR

public static final short ERROR
Indicates an error event

See Also:
Constant Field Values

WARNING

public static final short WARNING
Indicates a warning event

See Also:
Constant Field Values

INFORMATION

public static final short INFORMATION
Indicates an information event

See Also:
Constant Field Values

AUDIT_SUCCESS

public static final short AUDIT_SUCCESS
Indicates a success audit event

See Also:
Constant Field Values

AUDIT_FAILURE

public static final short AUDIT_FAILURE
Indicates a failure audit event

See Also:
Constant Field Values
Constructor Detail

EventLog

public EventLog()
Creates an EventLog object with app name


EventLog

public EventLog(java.lang.String source)
Creates an EventLog object given the name of the source

Parameters:
source - The name of the source referenced by the EventLog object.

EventLog

public EventLog(java.lang.String server,
                java.lang.String source)
Creates an EventLog object given the name of the source and the name of the server.

Parameters:
server - The Universal Naming Convention (UNC) name of the server that this operation is to be performed on.
source - The name of the source referenced by the EventLog object.
Method Detail

reportEvent

public void reportEvent(short type,
                        short cat,
                        int id)
Writes an entry at the end of the event log

Parameters:
type - The type of event being logged
cat - The event category
id - The event identifier, which specifies the message that goes with this event as an entry in the message file associated with the event source

reportEvent

public void reportEvent(short type,
                        short cat,
                        int id,
                        java.lang.String msg)
Writes an entry at the end of the event log, providing an associated string

Parameters:
type - The type of event being logged
cat - The event category
id - The event identifier, which specifies the message that goes with this event as an entry in the message file associated with the event source
msg - A string that is merged into the message before the message is displayed to the user

reportEvent

public void reportEvent(short type,
                        short cat,
                        int id,
                        java.lang.String[] msgs)
Writes an entry at the end of the event log, providing associated strings

Parameters:
type - The type of event being logged
cat - The event category
id - The event identifier, which specifies the message that goes with this event as an entry in the message file associated with the event source
msgs - An array of strings that are merged into the message before the message is displayed to the user

reportEvent

public void reportEvent(short type,
                        short cat,
                        int id,
                        java.lang.String msg,
                        byte[] data)
Writes an entry at the end of the event log, providing an associated string and binary data

Parameters:
type - The type of event being logged
cat - The event category
id - The event identifier, which specifies the message that goes with this event as an entry in the message file associated with the event source
msg - A string that is merged into the message before the message is displayed to the user
data - The binary data associated with the report

reportEvent

public void reportEvent(short type,
                        short cat,
                        int id,
                        java.lang.String[] msgs,
                        byte[] data)
Writes an entry at the end of the event log, providing associated strings and binary data

Parameters:
type - The type of event being logged
cat - The event category
id - The event identifier, which specifies the message that goes with this event as an entry in the message file associated with the event source
msgs - An array of strings that are merged into the message before the message is displayed to the user
data - The binary data associated with the report