I have a .NET service, based on ServiceBase
:
public partial class Service : ServiceBase
Something initiates stop on this service. The stuff logged during service stop is consistent with a regular stop using SCM, but user states he didn't initiate it. I am not sure if that is some sort of crash, or user error.
Since the OnStop
method is getting invoked, I would like to log some diagnostic information in order to see what caused the stop to occur. Is it possible to get this information at that point? I'm looking: what was user that initiated stop, from which workstation/ip address was it initiated, that sort of stuff. Any ideas?