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.
精彩评论