You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the Collector on Windows, users will generally want to run this as a Windows service. It's not possible to just run a .exe directly as a Windows service, so some minor modifications need to be made to the startup/service code.
Suggested implementation:
Add a separate main method on Windows (using build flags):
Check if the executable is running interactively & if so, run the Collector as normal
Otherwise, if the executable has been invoked from service control manager, implement the Handler interface as a wrapper around service.Application, and call svc.Run on this handler
In order to make minimal changes to existing code, make the signalsChannel, that is used to be notified of OS SIGTERM signals, available for this wrapper to use when the Windows svc.Stop or svc.Shutdown signals are received (see example code below).
Allow a zap hook to be supplied to service.newLogger() so that logging can be redirected to the Windows Event Viewer instead of being lost. We may want to limit this to INFO+ (or WARNING+) logs.
When running the Collector on Windows, users will generally want to run this as a Windows service. It's not possible to just run a .exe directly as a Windows service, so some minor modifications need to be made to the startup/service code.
Suggested implementation:
Add a separate main method on Windows (using build flags):
service.Application
, and call svc.Run on this handlersignalsChannel
, that is used to be notified of OSSIGTERM
signals, available for this wrapper to use when the Windowssvc.Stop
orsvc.Shutdown
signals are received (see example code below).service.newLogger()
so that logging can be redirected to the Windows Event Viewer instead of being lost. We may want to limit this to INFO+ (or WARNING+) logs.Sample code:
The text was updated successfully, but these errors were encountered: