We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent4400dd5 commit28a11a6Copy full SHA for 28a11a6
coderd/httpmw/logger.go
@@ -57,8 +57,7 @@ func Logger(log slog.Logger) func(next http.Handler) http.Handler {
57
// We already capture most of this information in the span (minus
58
// the response body which we don't want to capture anyways).
59
tracing.RunWithoutSpan(r.Context(),func(ctx context.Context) {
60
-// logLevelFn(ctx, r.Method)
61
-logContext.WriteLog(r.Context(),sw.Status)
+logContext.WriteLog(ctx,sw.Status)
62
})
63
64
}
@@ -100,9 +99,9 @@ func (c *RequestLoggerContext) WriteLog(ctx context.Context, status int) {
100
99
// includes proxy errors etc. It also causes slogtest to fail
101
// instantly without an error message by default.
102
ifstatus>=http.StatusInternalServerError {
103
-c.log.Error(ctx,c.message,"status_code",status)
+c.log.Error(ctx,c.message)
104
}else {
105
-c.log.Debug(ctx,c.message,"status_code",status)
+c.log.Debug(ctx,c.message)
106
107
108
coderd/httpmw/logger_test.gorenamed tocoderd/httpmw/logger_internal_test.go