开发者

EventLog.Source and EventLog.Delete(logName): Are "Source" and "logName" referring to the same property?

开发者 https://www.devze.com 2023-03-09 03:01 出处:网络
In reading about creating custom event logs, I came across something that is somewhat confusing. When creating a custom event log, one property you need to set is the Source, which apparently is any

In reading about creating custom event logs, I came across something that is somewhat confusing.

When creating a custom event log, one property you need to set is the Source, which apparently is any name you want to give to the log. When writing and reading to this custom log, you will specify this "So开发者_开发问答urce".

When deleting a log, you also need to provide a string parameter, but this one is called logName. These seem like the same thing.

Is this logName and the "Source" you originally specified the same propery? If so, why are they named differently (i.e. why isn't the parameter for the delete method just called "Source")? If not, what are they, how are they related?


No they are not. Source specifies what "application" or "source" is writing to the log. LogName is the actualy log name to write/read/delete.

0

精彩评论

暂无评论...
验证码 换一张
取 消