From f42de6e8a9fbfac9fba61c53579763a235bcffc4 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 11 Jan 2020 20:48:01 +0100 Subject: [PATCH] Add error log to http server Signed-off-by: Knut Ahlers --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 0e326a9..9ab4663 100644 --- a/main.go +++ b/main.go @@ -5,6 +5,8 @@ package main import ( "context" "net/http" + + log "github.com/sirupsen/logrus" ) func getHTTPClient(ctx context.Context) *http.Client { @@ -17,5 +19,5 @@ func getContext(r *http.Request) context.Context { func main() { initializeStorage() - http.ListenAndServe(cfg.Listen, nil) + log.WithError(http.ListenAndServe(cfg.Listen, nil)).Error("HTTP Server exited unexpectedly") }