eventlog

How do you create an event log source using WiX

I'm creating an installer for a website that uses a custom event log source. I would like our WiX based installer to create that event log source during installation. Does anyone know the best way to do this using the WiX framework. ...

Way to read Windows EventLog with Java

Does anyone have any pointers on how to read the Windows EventLog without using JNI? Or if you have to use JNI, are there any good open-source libraries for doing so? ...

What is the most reliable way to create a custom event log and event source during the installation of a .Net Service

I am having difficulty reliably creating / removing event sources during the installation of my .Net Windows Service. Here is the code from my ProjectInstaller class: // Create Process Installer ServiceProcessInstaller spi = new ServiceProcessInstaller(); spi.Account = ServiceAccount.LocalSystem; // Create Service ServiceInstaller si ...

Deleting Custom Event Log Source Without Using Code

I have an application that has created a number of custom event log sources to help filter its output. How can I delete the custom sources from the machine WITHOUT writing any code as running a quick program using System.Diagnostics.EventLog.Delete is not possible. I've tried using RegEdit to remove the custom sources from [HKEY_LOCAL_M...

.NET : How to set user information in an EventLog Entry?

The System.Diagnostics.EventLog class provides a way to interact with a windows event log. I use it all the time for simple logging... System.Diagnostics.EventLog.WriteEntry("MyEventSource", "My Special Message") Is there a way to set the user information in the resulting event log entry using .NET? ...

What is the easiest way using .net to check if events have been logged in the eventlog?

What is the easiest way to check if events have been logged in the eventlog during a period of time? I want to perform a series of automated test steps and then check if any errors were logged to the Application Event Log, ignoring a few sources that I'm not interested in. I can use System.Diagnostics.EventLog and then look at the Entri...

(Windows) Exception Handling: to Event Log or to Database?

I've worked in shops where I've implemented Exception Handling into the event log, and into a table in the database. Each have their merits, of which I can highlight a few based on my experience: Event Log Industry standard location for exceptions (+) Ease of logging (+) Can log database connection problems here (+) Can build report ...

How do I conditionally suppress application exceptions written to the event log?

I am working on a windows service that polls for a connection to a network enabled devices every 15 seconds. If the service is not able to connect to a device, it throws an exception and tries again in 15 seconds. All of this works great. But, lets say one of the devices is down for a day or more. I am filling up my exception log wit...

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

ASP.Net 3.5 running under IIS 7 doesn't seem to allow this out of the box. if (!EventLog.SourceExists("MyAppLog")) EventLog.CreateEventSource("MyAppLog", "Application"); EventLog myLog = new EventLog(); myLog.Source = "MyAppLog"; myLog.WriteEntry("Message"); ...

How do I get PowerShell to grab a logfile when it overflows?

I am using Powershell PSeventing plugin but have had no luck so far finding an event that triggers when an event log is full. I am looking everywhere MSDN .net events I know it has to do with maximum event log size but I can't find that trigger and I'm not sure how to get PSeventing to make thing happen. Can anyone help me. Thank in a...

Event log monitoring

I need to monitor my Windows Server event logs so that I know if there is a problem with any of my ASP.Net websites (IIS errors, windows login errors etc) - errors that would end up in the event log rather than being handled by my application's error logging. Has anyone had any experience of GFI Events Manager or Event Sentry? Is there ...

What is the best way to write event log entries?

I recently had a problem during the deployment of a windows service. Four computers did not cause any problems, but on the fifth any attempt to start the service failed due to an exception. The exception stack trace is written to the event log, so I though it should be easy to identify the cause: protected override void OnStart(string[]...

EventLog Intermittent Exception

Hi, I have an intermittent problem with some code that writes to a Windows Event Log, using C# and .Net's EventLog class. Basically, this code works day-to-day perfectly, but very occasionally, we start getting errors like this: "System.ArgumentException: Only the first eight characters of a custom log name are significant, and...

How to create Windows EventLog source from command line?

I'm creating an ASP.NET application that will log some stuff to Windows EventLog. To do this an event source has to be created first. This requires administrative priviledges so I cannot do it in the ASP.NET app. Is there an existing command-line application that is bundled with Windows that can create an event log source, or must I rol...

Custom value for the Event Log source property for ASP.NET errors

By default, ASP.NET records all uncaught exceptions to system Event Log. I’m aware of the fact that one should have a proper logging facility in place, but this is better than nothing and it serves well as a temporary solution. I would like to be able to filter efficiently the events in the log. I learned that, when logging programmatic...

How to identify users which are connected to a windows server via remote desktop

At my workplace, we have lab machines that we use to do our testing. The standard procedure to reserve a machine for testing was to walk around the office to make sure that no one was using the machine. This is highly inefficient and time consuming. At first, I set up a web page where people could reserve the lab machine but nobody...

How to read the Windows Event Log without an EventMessageFile?

I have code that reads the Windows Event Log. It uses OpenEventLog, ReadEventLog and gets the event source and event ID. Then it looks up the source under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application key, loads the appropriate DLL(s) according to what is listed in EventMessageFile and finally uses F...

How do you open the event log programatically?

I'm logging errors to the event log using the usual: System.Diagnostics.Trace.TraceError("<" + purpose + "><time>" + DateTime.Now.ToUniversalTime() + "</time><message>" + message + "</message></" + purpose + ">"); and am wondering if there is a way to call this log file and display it for the user (either in my own format or by openi...

Searching event log to find out when a program was uninstalled

I am trying to find out when a program was uninstalled on a Win2k machine by searching through the event log. Which log should I search and are there any good keywords to search on to tag the uninstall event? ...

What is event logging? and how do I write an event log file?

What is event logging? and how do I write an event log file for an application? I want to log all the activities of the application including when it uses a .dll, etc. and also show information of the application. ...