Skip to content

Commit 8ef5646

Browse files
committed
added comment for chi ctx extraction
1 parent d1ee48e commit 8ef5646

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

coderd/httpmw/loggermw/logger.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ func (c *SlogRequestLogger) WriteLog(ctx context.Context, status int) {
138138
slog.F("latency_ms", float64(end.Sub(c.start)/time.Millisecond)),
139139
)
140140

141+
// If the request is routed, add the route parameters to the log.
141142
if chiCtx := chi.RouteContext(ctx); chiCtx != nil {
142143
urlParams := chiCtx.URLParams
143144
routeParamsFields := make([]slog.Field, 0, len(urlParams.Keys))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy