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

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -