开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜