fix(logger): render full logfmt line as journal MESSAGE
The native journal handler only put the bare msg string in MESSAGE, so default `journalctl` output lost all slog attributes (env, name, ip_version, etc.) that were visible with the old TextHandler path. Wrap the slog-journal handler so each record's MESSAGE is rendered through slog.TextHandler — producing the same `level=INFO msg="..." key=val` format as before — while still emitting every attribute as a structured journal field for `journalctl -o verbose` / field-based filtering. Also fix go.mod: slog-journal is a direct dependency.
This commit is contained in:
2
go.mod
2
go.mod
@@ -16,6 +16,7 @@ require (
|
||||
github.com/samber/slog-multi v1.8.0
|
||||
github.com/segmentio/kafka-go v0.4.50
|
||||
github.com/spf13/cobra v1.10.2
|
||||
github.com/systemd/slog-journal v0.1.2
|
||||
go.opentelemetry.io/contrib/bridges/otelslog v0.18.0
|
||||
go.opentelemetry.io/contrib/exporters/autoexport v0.68.0
|
||||
go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.68.0
|
||||
@@ -71,7 +72,6 @@ require (
|
||||
github.com/samber/slog-common v0.22.0 // indirect
|
||||
github.com/spf13/afero v1.15.0 // indirect
|
||||
github.com/spf13/pflag v1.0.10 // indirect
|
||||
github.com/systemd/slog-journal v0.1.2 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasttemplate v1.2.2 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||
|
||||
Reference in New Issue
Block a user