Top Method Summary
Options Name Purpose
LOGICAL CreateEventSource (character) Creates an Event Source
LOGICAL CreateEventSourceAsAdministrator (character) Starts a new AVM with the "Run As Administrator" flag to create an Event Source
DisableEventSource (character) Disables an Event Source for the remainder of the session
LOGICAL EventSourceExists (character) Verifies if an EventSource exists
LOGICAL IsEventSourceDisabled (character) Returns if an Event Source has been disabled in the session
CHARACTER TruncateMessage (character) Truncates a message to the maximum length supported by the Windows Event Log
LOGICAL WriteMessage (character, character) Writes a Message to the EventLog
LOGICAL WriteMessage (character, character, EventLogEntryType) Writes a Message to the EventLog

Top Constructor Summary
Options Name Purpose
EventLogHelper () Constructor for the EventLogHelper class


Method Detail
Top

LOGICAL CreateEventSource (character)

Purpose: Creates an Event Source
Notes:

Parameters:
pcEventSource CHARACTER
The name of the Event Source to create
Returns LOGICAL
Logical value indicating if the EventSource has been created
Top

LOGICAL CreateEventSourceAsAdministrator (character)

Purpose: Starts a new AVM with the "Run As Administrator" flag to create an
Event Source
Notes:

Parameters:
pcEventSource CHARACTER
The name of the Event Source to create
Returns LOGICAL
Logical value indicating if the EventSource has been created
Top

DisableEventSource (character)

Purpose: Disables an Event Source for the remainder of the session
Notes: SCL-5918. Empty and unknown Event Source names are ignored, an
Event Source is only added once

Parameters:
pcEventSource CHARACTER
The name of the Event Source to disable
Top

LOGICAL EventSourceExists (character)

Purpose: Verifies if an EventSource exists
Notes:

Parameters:
pcEventSource CHARACTER
The name of the Event Source
Returns LOGICAL
Logical value indicating if the EventSource exists
Top

LOGICAL IsEventSourceDisabled (character)

Purpose: Returns if an Event Source has been disabled in the session
Notes: SCL-5918. The Event Source name is compared as a whole, also when
it contains a comma

Parameters:
pcEventSource CHARACTER
The name of the Event Source
Returns LOGICAL
Logical value indicating if the Event Source has been disabled
Top

CHARACTER TruncateMessage (character)

Purpose: Truncates a message to the maximum length supported by the
Windows Event Log
Notes: SCL-5918. System.Diagnostics.EventLog:WriteEntry throws an
ArgumentException for a message of more than 31839 characters.
A truncated message ends with "..."

Parameters:
pcMessage CHARACTER
The message to be written to the EventLog
Returns CHARACTER
The message, truncated to the maximum length when required
Top

LOGICAL WriteMessage (character, character)

Purpose: Writes a Message to the EventLog
Notes: Prevents from writing to Event Sources that are known to be not
available in the session

Parameters:
pcMessage CHARACTER
The message to be written to the EventLog
pcEventSource CHARACTER
The event source to be used for the message, will be created if required
Returns LOGICAL
Logical value indicating if the message has been written to the EventLog
Top

LOGICAL WriteMessage (character, character, EventLogEntryType)

Purpose: Writes a Message to the EventLog
Notes: Prevents from writing to Event Sources that are known to be not
available in the session. An Event Source is disabled for the
session when it cannot be created or accessed (SecurityException),
not when writing a single message fails. Messages exceeding the
maximum length of an Event Log entry are truncated (SCL-5918)

Parameters:
pcMessage CHARACTER
The message to be written to the EventLog
pcEventSource CHARACTER
The event source to be used for the message, will be created if required
poEntryType System.Diagnostics.EventLogEntryType
The System.Diagnostics.EventLogEntryType for the message
Returns LOGICAL
Logical value indicating if the message has been written to the EventLog


Constructor Detail
Top

EventLogHelper ()

Purpose: Constructor for the EventLogHelper class
Notes: Disallow instance creation



©2006-2026 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       10.10.2026 15:35:24