custom-eventlog

My custom Windows Service is not writing to my custom Event Log

此生再无相见时 提交于 2021-02-19 03:46:08
问题 I have written a custom Windows Service that writes data to a custom Event Log (in the Windows Event Viewer). For dev'ing the biz logic that the service uses, I created a Windows Form which simulates the Start/Stop methods of the Windows Service. When executing the biz logic via the Windows Forms, info is successfully written to my custom Event Log. However, when I run the same biz logic from the custom Windows Service, information is failing to be written to the Event Log. To be clear, I

Cannot open log for source {0} on Windows 2003 Server

安稳与你 提交于 2019-12-25 00:36:35
问题 I am having a huge problem with the eventlog on my server. Right let me first of all explain the setup. I have a domain setup with 2 computers One computer is running IIS the other is a workstation. The IIS is running Win2k3 the workstation Win XP. The IIS computer is hosting a website which uses Windows Impersonation and tries to log an entry to the eventlog for a custom log file called MyApp and a custom event source MySource I have a domain user called MyUser who is just a member of Domain

How do I write to a custom Windows event log?

对着背影说爱祢 提交于 2019-12-20 02:43:21
问题 I'm attempting to set up basic logging to the windows event log in .net via System.Diagnostics.EventLog, but I'm failing to see any events actually getting written to the log. Consider the following code: // Elsewhere in the class private static readonly string EventLogName = "LogName"; private static readonly string EventLogSource = "AppName"; // In the only function that does something if (!EventLog.Exists(EventLogName)) { EventLog.CreateEventSource(EventLogSource, EventLogName); return; }