application shutdown - How to log messages for signaltype in Tylerb Graceful in go? -


i have been looking go programming couple of days now. have been looking way of gracefully shutting down go app. app serves http request , should complete outstanding requests before exiting. using tylerb graceful.

https://github.com/tylerb/graceful

my question is:

how can log message captures type of signal? eg. interrupted, terminated or sigkill, sigterm, sigint

so far thing have been able implement simple message telling exited gracefully, if sigkill it, there no message being logged:

mux := // ...        srv := &graceful.server{              timeout: 10 * time.second,              server: &http.server{                      addr: ":1234",                      handler: mux,              },                       }        srv.listenandserve()        log.println("server stopped gracefully") 


Comments

Popular posts from this blog

python - RuntimeError: can't re-enter readline -

python - PyInstaller UAC not working in onefile mode -

ios - Pass NSDictionary from Javascript to Objective-c in JavascriptCore -