[英]Log4Net. Restrict RollingFileAppender to log events in Windows Event Viewer
[英]Writing to Event Log: don't see events in Event Log Viewer but do see them from under Visual Studio.Net
我正在VS.NET 2010 / C#中創建Windows服務,該服務使用事件日志組件進行日志記錄。 我創建了事件源,並且該服務在“本地系統”帳戶下運行,因此不會發生與安全相關的問題。
雖然在Visual Studio 2010(服務器瀏覽器)的“事件日志”視圖中確實看到了事件,但在Windows的標准“事件日志”實用工具中卻看不到它們。 有什么問題? 我的代碼如下。 預先感謝您的幫助!
public Service()
{
InitializeComponent();
if (!System.Diagnostics.EventLog.SourceExists("Photo Processing Service"))
{
System.Diagnostics.EventLog.CreateEventSource(
"Photo Processing Service", "fexpress");
}
fexpressLog.Source = "Photo Processing Service";
fexpressLog.Log = "fexpress";
}
然后...
fexpressLog.WriteEntry (...);
它們是否屬於“應用程序和服務日志->照片處理服務”而不是“ Windows日志->應用程序日志”?
我本人剛剛經歷了兩件事。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.