Is it possible to log who started or stopped a windows service?

前端 未结 5 1861
青春惊慌失措
青春惊慌失措 2020-12-16 12:21

I have some windows services written in C#. When somebody stops or starts the service, I would like to be able to determine who it was and log that information.

I t

5条回答
  •  半阙折子戏
    2020-12-16 13:11

    1. Just open Event Viewer (Start menu -> Search "Event" Event Viewer will come, open it)
    2. Expand 'Windows Log' on Event viewer left menu.
    3. Click on Application. (It will show your application error with description in 'general' tab.
    4. Again try to start your service and from event viewer see what is exact cause for stopping briefly in 'general' tab.

提交回复
热议问题