我想将 EventViewer 中的条目记录为“关键”,但我没有关联的 EventLogType:
System.Diagnostics.EventLog.WriteEntry("ApplicationName", message, System.Diagnostics.EventLogEntryType.Error);
根据 MSDN,EventLogEntryType只有 5 个可能的值:
Error
Warning
FailureAudit
Information
SuccessAudit
在事件查看器中,有 5 个严重级别:
Critical
Error
Warning
Information
Verbose
但它没有映射! 错误日志中的错误 警告日志警告 但 FailureAudit、Information 和 SuccessAudit 日志记录在 Information
您知道如何使用 EventLog.WriteEvent 记录关键事件吗?
最佳答案
我相信它仅由系统本身生成:
Critical events are sent to the user in the form of an immediate message on the screen. Other event notifications are written to one of several event logs that record the information for future reference.
关于c# - 如何记录严重级别的事件日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38746495/