In the Event Viewer in Windows 7 there is a Source column that is set by my Windows Service application. The value is set to TOS and usually when a log entry is associated to my application, it has TOS as the Source column value.
However, when the service fails to start (or some other kind of error occurs) I get a Source of one of the following values:
- Application Error
- Service Control Manager
- .NET Runtime
I don't understand why the value is not always TOS Also, is it possible to force it to use TOS every time?
The service encounters a fatal error and is unable to start. The exception is caught by the .Net framework and of course Service Control Manager is aware that the process did not start. The developer needs to handle the exit code properly for this fatal error to log to event viewer as the application source.
The article explains it quite well: http://www.devopsonwindows.com/handle-windows-service-errors/