Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.