【问题标题】:How to log an Event log in the Critical level?如何在严重级别记录事件日志?
【发布时间】:2016-08-03 14:30:20
【问题描述】:

我想将 EventViewer 中的条目记录为关键,但我没有关联的 EventLogType:

System.Diagnostics.EventLog.WriteEntry("ApplicationName", message, System.Diagnostics.EventLogEntryType.Error);

根据 MSDN,EventLogEntryType 只有 5 个可能的值:

Error   
Warning 
FailureAudit
Information
SuccessAudit

在 EventViewer 中,有 5 个严重级别:

Critical
Error
Warning
Information
Verbose

但它没有映射! 错误日志中的错误 警告中的警告日志 但是FailureAudit、Information和SuccessAudit登录Information

您知道如何使用 EventLog.WriteEvent 记录关键事件吗?

【问题讨论】:

标签: c# wpf event-log


【解决方案1】:

我相信它只是从系统本身生成的:

关键事件以屏幕上即时消息的形式发送给用户。其他事件通知将写入记录信息以供将来参考的多个事件日志之一。

Source MSDN

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-27
    • 1970-01-01
    • 1970-01-01
    • 2022-11-10
    • 2019-07-06
    • 2011-05-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多