feat: send request context into record context

This commit is contained in:
Samuel Berthe
2023-10-23 14:11:16 +02:00
parent 9b048ad34b
commit 7b2004ad1f
+1 -2
View File
@@ -2,7 +2,6 @@ package sloggin
import ( import (
"bytes" "bytes"
"context"
"io" "io"
"net/http" "net/http"
"strings" "strings"
@@ -194,7 +193,7 @@ func NewWithConfig(logger *slog.Logger, config Config) gin.HandlerFunc {
msg = c.Errors.String() msg = c.Errors.String()
} }
logger.LogAttrs(context.Background(), level, msg, attributes...) logger.LogAttrs(c.Request.Context(), level, msg, attributes...)
} }
} }