This documentation is archived and is not being maintained.

EventLogInstaller.Source Property

Gets or sets the source name to register with the log.

[Visual Basic]
Public Property Source As String
[C#]
public string Source {get; set;}
[C++]
public: __property String* get_Source();
public: __property void set_Source(String*);
[JScript]
public function get Source() : String;
public function set Source(String);

Property Value

The name to register with the event log as a source of entries. The default is an empty string ("").

Remarks

The event source indicates what logs the event. It is often the name of the application, or the name of a subcomponent of the application if the application is large. Applications and services should write to the Application log or a custom log. Device drivers should write to the System log.

If you do not specify a log name before the installer runs, the installer registers your source to the Application log. If you specify the name of a log that does not exist, the system registers the Source to that log, but the log is not created until the first entry is written to it.

If you create a new source, your application can use it to write to only one log at a time.

The installer uses the value of the Source property to register your application with the event log as a valid source of entries. The Source property can be any string, but the name cannot be used by other sources on the computer. An attempt to create a duplicated Source value throws an exception when the installer runs. However, a single event log can have many different sources writing to it.

For more detailed information about the behaviors of event logs and sources, see the EventLog class documentation for the Log and Source properties.

Requirements

Platforms: Windows NT Server 4.0, Windows NT Workstation 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

EventLogInstaller Class | EventLogInstaller Members | System.Diagnostics Namespace | EventLog.Source | EventLog

Show: