Skip to content

Commit

Permalink
Log server shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepeterson committed Aug 12, 2021
1 parent 669cc1c commit 5fe88c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/nanomdm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,12 @@ func main() {
})

logger.Info("msg", "starting server", "listen", *flListen)
http.ListenAndServe(*flListen, simpleLog(mux, logger.With("handler", "log")))
err = http.ListenAndServe(*flListen, simpleLog(mux, logger.With("handler", "log")))
logs := []interface{}{"msg", "server shutdown"}
if err != nil {
logs = append(logs, "err", err)
}
logger.Info(logs...)
}

func basicAuth(next http.Handler, username, password, realm string) http.HandlerFunc {
Expand Down

0 comments on commit 5fe88c6

Please sign in to comment.