[go: up one dir, main page]

Skip to content

WithGroup and WithAttrs not supported

Current logs looks like :

~/repo/test 
15:41:50 ❯ go run ./main.go -l info --text
(...)
2023-11-07 15:42:00 INFO  ../webfmwk/handler/slogging/logging.go:43 --> new request
2023-11-07 15:42:00 INFO  ../webfmwk/handler/slogging/logging.go:60 <-- request done code="200" elapsed="73.509µs"

While the following is expected:

~/repo/test took 1m 17.9s 
15:44:37 ✘ 1 ❯ go run ./main.go -l dbg --tint
(...)
2023-11-07 15:42:00 INFO  ../webfmwk/handler/slogging/logging.go:43 --> new request request.id="4294967297" request.ip="@" request.method="GET" request.uri="/version"
2023-11-07 15:42:00 INFO  ../webfmwk/handler/slogging/logging.go:60 <-- request done  request.id="4294967297" request.ip="@" request.method="GET" request.uri="/version" code="200" elapsed="73.509µs"

The following piece of code is ignored:

lg := c.GetStructuredLogger().With(
			slog.Group("request",
				slog.String("id", rid),
				slog.String("ip", webfmwk.GetIPFromRequest(fc)),
				slog.String("method", string(fc.Method())),
				slog.String("uri", string(fc.RequestURI()))))
Edited by Quentin Burgess