Update hlog_mw.go
This commit is contained in:
parent
8257e6c4aa
commit
0c14562b95
@ -11,9 +11,9 @@ const HlogCtxKey string = "logger"
|
||||
func ContextLogger(logger hlog.Logger) fiber.Handler {
|
||||
return func(c *fiber.Ctx) error {
|
||||
c.Locals(HlogCtxKey, logger.With(map[string]string{
|
||||
"ctxuserip": c.IP(),
|
||||
"ctxuserport": c.Port(),
|
||||
"keydomain": strings.Join(c.Subdomains(), "/"),
|
||||
"ctxuserip": c.Get("X-Real-IP"),
|
||||
"ctxuserport": c.Get("X-Client-Port"),
|
||||
"keydomain": c.Hostname(),
|
||||
"keypath": c.Path(),
|
||||
}))
|
||||
return c.Next()
|
||||
|
Loading…
Reference in New Issue
Block a user