Gets an event log you can use to write notification of service command calls, such as Start and Stop, to the Application event log.

Namespace:   System.ServiceProcess
Assembly:  System.ServiceProcess (in System.ServiceProcess.dll)

[BrowsableAttribute(false)]
public virtual EventLog EventLog { get; }
public:
[BrowsableAttribute(false)]
property EventLog^ EventLog {
	virtual EventLog^ get();
}
[<BrowsableAttribute(false)>]
abstract EventLog : EventLog with get
[<BrowsableAttribute(false)>]
override EventLog : EventLog with get
<BrowsableAttribute(False)>
Public Overridable ReadOnly Property EventLog As EventLog

Property Value

Type:

An EventLog instance whose source is registered to the Application log.

The constructor initializes the property to an instance with the and properties set. The source is the of the service, and the log is the computer's Application log. These values are set automatically and cannot be changed for automatic logging of service commands.

When is true, Start, Stop, Pause, Continue, and custom commands are recorded automatically in the Application event log. You can use the property to write additional messages to that log as well. The component calls EventLogWriteEntry using this member.

To report information to a custom event log rather than the Application log, set to false and write instructions within the command-handling methods OnContinue, OnPause, or OnStop to post to the appropriate log.

.NET Framework
Available since 1.1
Return to top