开发者

How to implement correlation ID in Windows EventLog with .NET?

开发者 https://www.devze.com 2022-12-11 06:24 出处:网络
we are about to start using EventLog as our Centralized Auditing solution. A problem I am facing right now is recording correlation of log entries. For example we have operation that starts in one com

we are about to start using EventLog as our Centralized Auditing solution. A problem I am facing right now is recording correlation of log entries. For example we have operation that starts in one component and ends in another one.开发者_Go百科 This operation has unique ID. So I need to correlate entries with Operation ID.

How to store this Operation ID to the EventLog? Later Operation ID will be used to filter events in Windows Event Viewer.

In Windows EventLog I found Correlation ID field. Seems I can use it. But I cannot find related API in .NET System.Diagnostics.EventLog. Even more, I cannot find information about this field.

Please suggest best practises about subj.


Look at TraceSource and the CorrelationManager, you should probably use this instead of writing to the eventlog yourself.

0

精彩评论

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

关注公众号