O'Reilly logo

Programming .NET Security by Allen Jones, Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programming the Event Log Service

The .NET Framework exposes ELS functionality through the System.Diagnotics.EventLog class; Table 20-3 summarizes the public members of the EventLog class.

Table 20-3. Public members of the EventLog class

Member

Description

Properties

 

EnableRaisingEvents

Gets or sets a value indicating whether the EventLog instance receives EventWritten event notifications. See Section 20.2.6 for details.

Entries

Returns the contents of the event log.

Log

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

LogDisplayName

Gets the user-friendly name of the event log.

MachineName

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

Source

Gets or sets the name of the event source used to write events to the log.

Methods

 

Clear

Removes all of the event entries from an event log.

CreateEventSource

Registers a new event source.

Delete

Deletes a specified event log from the ELS.

DeleteEventSource

Removes the registration for an event source.

Exists

Determines if a specified event log exists.

GetEventLogs

Obtains an EventLog array representing all of the event logs on the local or a remote computer. See Section 20.2.1 for details.

LogNameFromSourceName

Returns the name of the event log with which a specific event source is associated.

SourceExists

Determines if a specific event source has been registered with the ELS.

WriteEntry

Writes an event to the log. See Section ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required