Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Log Property
Collapse the table of content
Expand the table of content

EventLogInstaller.Log Property

Gets or sets the name of the log to set the source to.

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

Property Value

The name of the log. This can be Application, System, Security, or a custom log name. The default is an empty string ("").

Remarks

You can use the Log property to associate the source you specify in the Source property with either an existing log or a new log on the local computer. The installer uses this information to map the source to the log in the computer's registry.

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

If you write to an event log, you must specify the Log property, and create a new source. The installer uses the value of the Source property to register your application with the event log as a valid source of entries. Whether specifying a new log or an existing one in the Log property, if the source already exists on the local computer, the install utility will throw an exception when it tries to create the duplicate event source. If you specify a new source and an existing log, the installer creates a new event source and associates it with the log you specify. If you specify both a new source and a new log, the installer associates the new source with the new log in the registry, but the log is not created until the first entry is written 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.Log | EventLog

Show:
© 2015 Microsoft