我目前正在开发一个 (C++) 应用程序,它试图通过 Windows 事件日志获取系统范围的事件。
我正在使用 EvtSubscribe
API,MSDN 对其进行了很好的描述。
一切正常,我成功收到了发生的任何事件的通知。
令我困扰的是,我偶然发现了一个网络引用,它描述了一种我以前从未见过的事件类型:“Activity Tracing”。
所有其他(关键、错误、信息等)事件类型都是使用 EvtRender
API 和 EvtSystemLevel
/EvtSystemKeywords
getter 获取的.
Google 搜索充满了误报,因为关键字“Activity”和“Tracing”被重复用于多个应用程序和基础架构。
我最好的线索来自 reference我们发现,由不同的事件日志收集框架的用户编写:
Microsoft use it to troubleshoot aplications.
Negotiation/SCT exchange. This can happen at the transport later (through binary data exchange) or message layer (through SOAP message exchanges). Message encryption/decryption, with signature verification and authentication. Traces appear in the ambient activity, typically "Process Action."
Authorization and verification. This can happen locally or when communicating between endpoints.
Using Tracing to Troubleshoot Your Application http://msdn.microsoft.com/en-us/library/aa738639.aspx
Activity Tracing in Message Security http://msdn.microsoft.com/en-us/library/aa738609.aspx
当我尝试检查这些链接时,我发现这种跟踪机制允许对 WCF 应用程序进行故障排除。
但是,至少可以说我不是 WCF 专家,我不想花几天时间设置 .NET 环境并强制示例 WCF 应用程序启用此功能并触发此类事件日志。
谁能推荐一种快速生成此类事件日志的方法?
最佳答案
您可以按照此处所述配置 WCF 跟踪:https://learn.microsoft.com/en-us/dotnet/framework/wcf/diagnostics/tracing/configuring-tracing .这就是全部配置,无需编码
配置监听器时,可以使用 EventLogTraceListener。这将产生事件跟踪事件。
关于.net - 在 Windows 上生成 ActivityTracing 事件日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46464180/