Skip to content

Commit

Permalink
feat: show client ip on log
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbekhen committed Sep 24, 2023
1 parent b7f03c2 commit 982e440
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nanoproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 982e440

Please sign in to comment.