I just created a Windows service application in Visual Studio using the Windows Service project template. When I install and run the service, I notice that it automatically logs certain events to the Windows application event log. For example:
Service started successfully.
or
PowerEvent handled successfully by the service.
I plan to implement my own event logging with more detail, so these auto-generated messages will end up being extra "noise" that I don't want cluttering the log. Is there any way to prevent the service from writing the default messages into the event log?
Use the autolog property for the service:
this.AutoLog = false;
More information here: http://msdn.microsoft.com/en-us/library/f6567h1s.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With