From 982e440cc424bba6ff9848c912978753311967a8 Mon Sep 17 00:00:00 2001 From: Achmad Irianto Eka Putra Date: Mon, 25 Sep 2023 03:01:52 +0700 Subject: [PATCH] feat: show client ip on log --- nanoproxy.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nanoproxy.go b/nanoproxy.go index 6d3a952..f5f2f27 100644 --- a/nanoproxy.go +++ b/nanoproxy.go @@ -40,7 +40,10 @@ func main() { server.Use(recoverFiber.New()) server.Use(basicauth.New(basicauth.Config{Users: cfg.BasicAuth()})) server.Use(hopbyhop.New()) - server.Use(fiberzerolog.New(fiberzerolog.Config{Logger: &logger})) + server.Use(fiberzerolog.New(fiberzerolog.Config{ + Logger: &logger, + Fields: []string{"ip", "latency", "status", "url", "error"}, + })) // routes server.All("*", srv.Handler)