feat: send request context into record context
This commit is contained in:
+1
-2
@@ -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...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user