我正在尝试使用以下方法将事件级别设置为严重:
WriteEvent(id, categoryName, EventSeverity.ErrorCritical, entry);
但是在事件日志中它只显示事件级别为错误而不是严重。 我还需要设置其他配置和参数吗?
最佳答案
您是说 Microsoft.SharePoint.Administration.EventSeverity
吗?它由 ShP 使用并映射到它自己的事件日志。
使用映射到 Windows 事件日志的 System.Diagnostics.EventLogEntryType
的正确方法:
Error
Warning
Information
SuccessAudit
FailureAudit
关于c# - 如何使用 WriteEvent 将事件记录为 Critical,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11648682/