Skip to content

Commit c384706

Browse files
committed
fix empty RequestLoggerContext
1 parent 0e397ed commit c384706

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

coderd/httpmw/logger.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ func Logger(log slog.Logger) func(next http.Handler) http.Handler {
3535
slog.F("start", start),
3636
)
3737

38-
logContext := &RequestLoggerContext{}
38+
logContext := &RequestLoggerContext{
39+
Fields: map[string]any{},
40+
log: &slog.Logger{},
41+
written: false,
42+
}
3943
defer func() {
4044
logContext.WriteLog(r.Context(), "", sw.Status)
4145
}()

0 commit comments

Comments
 (0)