TCnEventLog Class

Provides interaction with Windows event logs.

Namespace: CNClrLib.Component.EventLog
TComponent
  CNClrLib.Control.Base.TClrBaseComponent
    CNClrLib.Component.EventLog.TCnEventLog
type
 TCnEventLog = class(TClrBaseComponent)
 end;

The TCnEventLog type exposes the following members.

Show:
 NameDescription
Create(TComponent)

Creates and initializes a TCnEventLog instance. (Overrides TClrBaseComponent.Create(TComponent).)

Destroy

Frees the resources allocated with a TCnEventLog instance. (Overrides TClrBaseComponent.Destroy.)

Top
Show:
 NameDescription
DefaultClrObject

Get the common language runtime object interface for this component. (Inherited from TClrBaseComponent.)

EnableRaisingEvents

Gets or sets a value indicating whether the CnEventLog receives OnEntryWritten event notifications.

Entries

Gets the contents of the event log.

Log

Gets or sets the name of the log to read from or write to.

LogDisplayName

Gets the event log's friendly name.

MachineName

Gets or sets the name of the computer on which to read or write events.

MaximumKilobytes

Gets or sets the maximum event log size in kilobytes.

MinimumRetentionDays

Gets the number of days to retain entries in the event log.

OverflowAction

Gets the configured behavior for storing new entries when the event log reaches its maximum log file size.

Source

Gets or sets the source name to register and use when writing to the event log.

SynchronizingObject

Gets or sets the object used to marshal the event handler calls issued as a result of an CnEventLog entry written event.

Top
Show:
 NameDescription
BeginInit

Begins the initialization of an CnEventLog used on a form or used by another component. The initialization occurs at runtime.

Clear

Removes all entries from the event log.

Close

Closes the event log and releases read and write handles.

CreateEventSource(String,String)

Overloaded. Establishes the specified source name as a valid event source for writing entries to a log on the local computer. This method can also create a new custom log on the local computer.

CreateEventSource(_EventSourceCreationData)

Overloaded. Establishes a valid event source for writing localized event messages, using the specified configuration properties for the event source and the corresponding event log.

Delete(String)

Overloaded. Removes an event log from the local computer.

Delete(String,String)

Overloaded. Removes an event log from the specified computer.

DeleteEventSource(String)

Overloaded. Removes the event source registration from the event log of the local computer.

DeleteEventSource(String,String)

Overloaded. Removes the application's event source registration from the specified computer.

Dispose

Releases the resources used by the Component. (Inherited from TClrBaseComponent.)

DoGetDefaultClrObject

Represents method DoGetDefaultClrObject. (Inherited from TClrBaseComponent.)

DoGetDotNetBaseComponent

Represents method DoGetDotNetBaseComponent. (Overrides TClrBaseComponent.DoGetDotNetBaseComponent.)

EndInit

Ends the initialization of an EventLog used on a form or by another component. The initialization occurs at runtime.

Exists(String)

Overloaded. Determines whether the log exists on the local computer.

Exists(String,String)

Overloaded. Determines whether the log exists on the specified computer.

GetClrObject

Represents method GetClrObject. (Inherited from TClrBaseComponent.)

GetEventLogs

Overloaded. Searches for all event logs on the local computer and creates an array of EventLog objects that contain the list.

GetEventLogs(String)

Overloaded. Searches for all event logs on the given computer and creates an array of EventLog objects that contain the list.

GetLogNames(TStrings)

get the names of all event logs on the local computer.

LogNameFromSourceName(String,String)

Gets the name of the log to which the specified source is registered.

ModifyOverflowPolicy(TOverflowAction,Integer)

Changes the configured behavior for writing new entries when the event log reaches its maximum file size.

RegisterDisplayName(String,Int64)

Specifies the localized name of the event log, which is displayed in the server Event Viewer.

RegisterEventCallBack(ClrWString,Pointer)

Add an event to the instance using the specified event name and function pointer which is the event handler. The RegisterEventCallBack method does not directly add the event handler to the event. A hooking mechanism is used such that if the event is fired, the hook event is also fired which in turn calls the function pointer. (Inherited from TClrBaseComponent.)

RegisterEventSource

Register the Delphi object which will raise the .Net event handler. (Inherited from TClrBaseComponent.)

SourceExists(String)

Overloaded. Determines whether an event source is registered on the local computer.

SourceExists(String,String)

Overloaded. Determines whether an event source is registered on a specified computer.

UnRegisterEventCallBack(ClrWString,Pointer)

Remove an event from the instance using the specified event name and function pointer which is the event handler. (Inherited from TClrBaseComponent.)

UnRegisterEventSource

Unregister the Delphi object which raised the .Net event handler. (Inherited from TClrBaseComponent.)

WriteEntry(String)

Overloaded. Writes an information type entry, with the given message text, to the event log.

WriteEntry(String,String)

Overloaded. Writes an information type entry with the given message text to the event log, using the specified registered event source.

WriteEntry(String,String,TEventLogEntryType)

Overloaded. Writes an error, warning, information, success audit, or failure audit entry with the given message text to the event log, using the specified registered event source.

WriteEntry(String,String,TEventLogEntryType,Integer)

Overloaded. Writes an entry with the given message text and application-defined event identifier to the event log, using the specified registered event source.

WriteEntry(String,String,TEventLogEntryType,Integer,SmallInt)

Overloaded. Writes an entry with the given message text, application-defined event identifier, and application-defined category to the event log, using the specified registered event source. The category can be used by the Event Viewer to filter events in the log.

WriteEntry(String,String,TEventLogEntryType,Integer,SmallInt,TArray)

Overloaded. Writes an entry with the given message text, application-defined event identifier, and application-defined category to the event log (using the specified registered event source) and appends binary data to the message.

WriteEntry(String,String,TEventLogEntryType,Integer,SmallInt,_ByteArray)

Overloaded. Writes an entry with the given message text, application-defined event identifier, and application-defined category to the event log (using the specified registered event source) and appends binary data to the message.

WriteEntry(String,TEventLogEntryType)

Overloaded. Writes an error, warning, information, success audit, or failure audit entry with the given message text to the event log.

WriteEntry(String,TEventLogEntryType,Integer)

Overloaded. Writes an entry with the given message text and application-defined event identifier to the event log.

WriteEntry(String,TEventLogEntryType,Integer,SmallInt)

Overloaded. Writes an entry with the given message text, application-defined event identifier, and application-defined category to the event log.

WriteEntry(String,TEventLogEntryType,Integer,SmallInt,TArray)

Overloaded. Writes an entry with the given message text, application-defined event identifier, and application-defined category to the event log, and appends binary data to the message.

WriteEntry(String,TEventLogEntryType,Integer,SmallInt,_ByteArray)

Overloaded. Writes an entry with the given message text, application-defined event identifier, and application-defined category to the event log, and appends binary data to the message.

WriteEvent(String,_EventInstance,TArray)

Overloaded. Writes an event log entry with the given event data and message replacement strings, using the specified registered event source.

WriteEvent(String,_EventInstance,_ByteArray,TArray)

Overloaded. Writes an event log entry with the given event data, message replacement strings, and associated binary data, and using the specified registered event source.

WriteEvent(String,_EventInstance,_ByteArray,_ObjectArray)

Overloaded. Writes an event log entry with the given event data, message replacement strings, and associated binary data, and using the specified registered event source.

WriteEvent(String,_EventInstance,_ObjectArray)

Overloaded. Writes an event log entry with the given event data and message replacement strings, using the specified registered event source.

WriteEvent(_EventInstance,TArray)

Overloaded. Writes a localized entry to the event log.

WriteEvent(_EventInstance,TArray,TArray)

Overloaded. Writes an event log entry with the given event data, message replacement strings, and associated binary data.

WriteEvent(_EventInstance,_ByteArray,_ObjectArray)

Overloaded. Writes an event log entry with the given event data, message replacement strings, and associated binary data.

WriteEvent(_EventInstance,_ObjectArray)

Overloaded. Writes a localized entry to the event log.

Top
Show:
 NameDescription
OnEntryWritten

Occurs when an entry is written to an event log on the local computer.

Top

See C:\Users\Public\Documents\CrystalNet Technologies\.Net VCL for Delphi Demo Folder after installation for examples of how to use this component.