Feat: add query params

This commit is contained in:
2025-11-10 11:07:36 +08:00
parent 9a39bcda40
commit dbd2ed6469
16 changed files with 293 additions and 37 deletions

View File

@@ -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)
}
}