问题描述
我正在开发一个服务框架来简化我们服务的开发,并通过采用可靠的设计模式帮助使它们更加统一。
我有一个问题不是通过搜索网络很容易得到答案,服务是否可以判断它是否正常"正常"开始。或者作为恢复重启的结果。
如果应用程序日志可能有一条消息,例如"由于先前故障后恢复而导致服务重新启动",那将会很有帮助。或者其他什么,我们可以记录,如果我们可以判断开始是重启。
Thx
I 'm developing a service framework to simplify the development of our services and help make them more uniform by adopting a solid design pattern.
A question I have that's not easy to get an answer to by searching web, is whether a service can tell if its being started "normally" or as the result of a recovery restart.
It would be helpful if the Application log could have a message like "Service restarting due to recovery after prior failure" or something, we could log that IF we could tell that the start was a restart.
Thx
这篇关于Windows服务恢复/重新启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!