Skip to content

Commit

Permalink
feat: send request context into record context
Browse files Browse the repository at this point in the history
  • Loading branch information
samber committed Oct 23, 2023
1 parent 9b048ad commit 7b2004a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package sloggin

import (
"bytes"
"context"
"io"
"net/http"
"strings"
Expand Down Expand Up @@ -194,7 +193,7 @@ func NewWithConfig(logger *slog.Logger, config Config) gin.HandlerFunc {
msg = c.Errors.String()
}

logger.LogAttrs(context.Background(), level, msg, attributes...)
logger.LogAttrs(c.Request.Context(), level, msg, attributes...)
}
}

Expand Down

0 comments on commit 7b2004a

Please sign in to comment.