首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法将事件日志写入指定的日志

无法将事件日志写入指定的日志
EN

Stack Overflow用户
提问于 2017-06-14 14:02:24
回答 0查看 51关注 0票数 0

我尝试将新日志写入MyLog,但它总是写入应用程序日志(Windows Log)

代码语言:javascript
复制
 string sSource;
 string sLog;
 sSource = "MySource";
 sLog = "MyLog";
 if (!EventLog.SourceExists(sSource))
     EventLog.CreateEventSource(sSource, sLog);
 using (EventLog eventLog = new EventLog(sLog))
 {
     eventLog.Source = sSource;
     eventLog.WriteEntry("Log message example", EventLogEntryType.Information, 101, 1);
 }

我尝试删除注册表上的日志条目以重新创建日志,但问题仍然存在。

帮个忙吧。

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44536635

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档