diff options
Diffstat (limited to 'pkg/cfg')
| -rw-r--r-- | pkg/cfg/mux.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pkg/cfg/mux.go b/pkg/cfg/mux.go index 694ee9e..a55b443 100644 --- a/pkg/cfg/mux.go +++ b/pkg/cfg/mux.go @@ -1,9 +1,17 @@ package cfg -import "net/http" +import ( + "net/http" + + sloghttp "github.com/samber/slog-http" + xlog "gitlab.com/mokhax/spike/pkg/log" +) func WithMux(mux http.Handler) Option { return func(config *Config) { - config.Mux = mux + config.Mux = sloghttp.NewWithConfig(xlog.Logger, sloghttp.Config{ + WithSpanID: true, + WithTraceID: true, + })(sloghttp.Recovery(mux)) } } |
