增加了一个EventLogAppender如下:
Added an EventLogAppender as Follows:
<appender name="eventLogAppender" type="log4net.Appender.EventLogAppender,log4net" >
<mapping>
<level value="ERROR" />
<eventLogEntryType value="Error" />
</mapping>
<mapping>
<level value="DEBUG" />
<eventLogEntryType value="Information" />
</mapping>
<mapping>
<level value="INFO" />
<eventLogEntryType value="Information" />
</mapping>
<mapping>
<level value="WARN" />
<eventLogEntryType value="Warning" />
</mapping>
<logName value="NewLogName" />
<applicationName value="AppName" />
<layout type="log4net.Layout.PatternLayout,log4net">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
它创建 NewLogName
的新日志,并将其添加窗口事件与 AppName的
的应用程序名称,但它增加了事件的应用程序
日志instaed的 NewLogName
。
It creates the new log of NewLogName
and it adds windows events with the app name of AppName
but it adds the events to the Application
Log instaed of NewLogName
.
我更改权限在注册表和应用程序的名称在注册表中的正确位置。任何想法?
I've changed permissions in the registry and the Application Name is in the correct spot in the registry. Any ideas?
在转向log4net的调试真的,我没有得到任何错误。它在事件查看器中创建的 NewLogName
。该是没有重复的。我重新启动事件收集器和事件日志服务,它并没有解决它。我重新启动我的电脑昨天晚上,它看起来像固定它。
When turning log4net to debug true, I don't get any errors. It created the NewLogName
in the Event Viewer. The is no duplicate. I restarted the Event Collector and the Event Log services and it didn't fix it. I rebooted my computer last night and it looks like that fixed it.