Feat: add query params
This commit is contained in:
@@ -8,9 +8,14 @@ import (
|
||||
|
||||
func AccessLog(next tcp.Handler) tcp.Handler {
|
||||
return func(w tcp.ResponseWriter, req *tcp.Request) error {
|
||||
params := []string{}
|
||||
for key, val := range req.Params {
|
||||
params = append(params, key+"="+val)
|
||||
}
|
||||
zap.L().Info("access",
|
||||
zap.String("method", string(req.Method)),
|
||||
zap.String("route", req.Route))
|
||||
zap.String("route", req.Route),
|
||||
zap.Strings("params", params))
|
||||
return next(w, req)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user