ASP.Net Core 1 Logging Error – The description for Event ID xxxx from source Application cannot be found

I have not been able to use the loggerFactory.AddEventLog() in .Net Core 2.0. As the Microsoft.Extensions.Logger.EventLog only lives in .net 4.5.1 although the Nuget package is available for 2.0.0 here , so looks like it needs to be ported to Core. but maybe this will work for you. Add your CustomEventIds public static class CustomEventIds … Read more

EventLog write permissions

By default, any authenticated user is able to write to application event log. However only administrators can create new event Sources. If all event Sources are known at the service installation time, I recommend register those sources ahead of time, then you will be all set up. Registering is a simple call to EventLog.CreateEventSource. If … Read more

What do I need to change to allow my IIS7 ASP.Net 3.5 application to create an event source and log events to Windows EventLog?

I’ve copied this answer from here (the question was Log4Net but the answer still applies). The technet link misses a vital step. Create a registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Application\MY-AWESOME-APP Create a string value inside this Name it EventMessageFile, set its value to C:\Windows\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll That path appears to work in both 64 bit and 32 bit environments. With … Read more

Writing Exceptions to the Windows Log File

You can use the System.Diagnostics.EventLog.WriteEntry function to write entries to the event log. System.Diagnostics.EventLog.WriteEntry(“MyEventSource”, exception.StackTrace, System.Diagnostics.EventLogEntryType.Warning); To read event logs you can use the System.Diagnostics.EventLog.GetEventLogs function. //here’s how you get the event logs var eventLogs = System.Diagnostics.EventLog.GetEventLogs(); foreach(var eventLog in eventLogs) { //here’s how you get the event log entries foreach(var logEntry in eventLog.Entries) { … Read more

How to determine if an EventLog already exists

# Check if Log exists # Ref: http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog.exists(v=vs.110).aspx [System.Diagnostics.EventLog]::Exists(‘Application’); # Ref: http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog.sourceexists(v=vs.110).aspx # Check if Source exists [System.Diagnostics.EventLog]::SourceExists(“YourLogSource”);

Description for event id from source cannot be found

I got this error after creating an event source under the Application Log from the command line using “EventCreate”. This command creates a new key under: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application If you look at the Key that’s been created (e.g. SourceTest) there will be a string value calledEventMessageFile, which for me was set to %SystemRoot%\System32\EventCreate.exe. Change this to … Read more

Deleting Custom Event Log Source Without Using Code

I also think you’re in the right place… it’s stored in the registry, under the name of the event log. I have a custom event log, under which are multiple event sources. HKLM\System\CurrentControlSet\Services\Eventlog\LOGNAME\LOGSOURCE1 HKLM\System\CurrentControlSet\Services\Eventlog\LOGNAME\LOGSOURCE2 Those sources have an EventMessageFile key, which is REG_EXPAND_SZ and points to: C:\Windows\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll I think if you delete the Key that … Read more

c# writing to the event viewer

The problem is probably that you are trying to create an event source in a log that doesn’t exist. You need to specify the “Application” log. Try changing it to: if (!EventLog.SourceExists(cs)) EventLog.CreateEventSource(cs, “Application”); EventLog.WriteEntry(cs, message, EventLogEntryType.Error); Also: Inside of sharepoint, if the app is running as logged in user(via windows auth or delegation), the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)