是否可以在ETW中使用自定义关键字?
我在我的应用程序中使用ETW进行日志记录/跟踪/诊断,我希望能够分配关键字以便于查询日志。诊断,定时事件,信息以及更具体的其他信息,例如DB Connection或其他。
答案 0 :(得分:2)
是的,当您使用EventSource Package:
时,这是可行的public class Keywords // This is a bitvector
{
public const EventKeywords Requests = (EventKeywords)0x0001;
public const EventKeywords Debug = (EventKeywords)0x0002;
}
在添加NuGet包后,您可以在解决方案中找到_EventSourceUsersGuide.docx
中的说明。