diff --git a/pkg/http/logger.go b/pkg/http/logger.go index 91d7f54..c3557f8 100644 --- a/pkg/http/logger.go +++ b/pkg/http/logger.go @@ -8,6 +8,7 @@ package http import ( "log" "net/http" + "os" "time" ) @@ -34,6 +35,7 @@ func (w *loggerResponseWriter) Flush() { } func LogRequest(next http.Handler) http.Handler { + stdout := log.New(os.Stdout, "", log.LstdFlags) return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { t := time.Now() logger := loggerResponseWriter{w, 0, 0} @@ -45,7 +47,7 @@ func LogRequest(next http.Handler) http.Handler { if statusCode == 0 { statusCode = http.StatusOK } - log.Printf("HTTP - %s %s \"%s\" %d %d %s\n", + stdout.Printf("HTTP - %s %s \"%s\" %d %d %s\n", RemoteAddr(r), r.Method, requestPath,