diff options
Diffstat (limited to 'logging')
-rw-r--r-- | logging/middleware.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/logging/middleware.go b/logging/middleware.go index ffce1b7..b19c273 100644 --- a/logging/middleware.go +++ b/logging/middleware.go @@ -16,6 +16,15 @@ func LogRequests(logger Logger) sr.Middleware { response := inner.Handle(ctx, request) if response != nil { response.Body = loggingBody(logger, request, response, start) + } else { + end := time.Now() + logger.Log( + "msg", "request", + "ts", end.UTC(), + "dur", end.Sub(start), + "url", request.URL, + "status", "(not found)", + ) } return response |