我的App.COnfig中包含以下项目,可以写入Windows事件日志
<add key="serilog:using:EventLog" value="Serilog.Sinks.EventLog" />
<add key="serilog:write-to:EventLog" />
<add key="serilog:write-to:EventLog.source" value="MyXYZSource" />
<add key="serilog:write-to:EventLog.manageEventSource" value="true" />
但是我在Eventlog中看到垃圾消息以及我的主要消息:
The description for Event ID 43413 from source MyXYZSource cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The message resource is present but the message was not found in the message table
我不知道事件ID 43413的来源?
如果我可以将事件ID = 1分配给Serilog写入的事件,则可以轻松解决该问题。
在上面显示的App.Config中是否有一种简单的方法?