Skip to content

Commit

Permalink
feat: adding params+query
Browse files Browse the repository at this point in the history
  • Loading branch information
samber committed Jan 3, 2024
1 parent 20c3de5 commit 24a5910
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ func NewWithConfig(logger *slog.Logger, config Config) echo.MiddlewareFunc {
res := c.Response()
start := time.Now()
path := req.URL.Path
query := req.URL.RawQuery

params := map[string]string{}
for i, k := range c.ParamNames() {
params[k] = c.ParamValues()[i]
}

// dump request body
br := newBodyReader(req.Body, RequestBodyMaxSize, config.WithRequestBody)
Expand Down Expand Up @@ -145,6 +151,8 @@ func NewWithConfig(logger *slog.Logger, config Config) echo.MiddlewareFunc {
slog.String("method", method),
slog.String("host", host),
slog.String("path", path),
slog.String("query", query),
slog.Any("params", params),
slog.String("route", route),
slog.String("ip", ip),
slog.String("referer", referer),
Expand Down

0 comments on commit 24a5910

Please sign in to comment.