fix(ekko): include client IP in request logs
Use slogecho.DefaultConfig() instead of a zero-value struct literal so WithClientIP (and WithRequestID) defaults are inherited.
This commit is contained in:
10
ekko/ekko.go
10
ekko/ekko.go
@@ -162,12 +162,10 @@ func (ek *Ekko) setup(ctx context.Context) (*echo.Echo, error) {
|
||||
},
|
||||
}))
|
||||
|
||||
e.Use(slogecho.NewWithConfig(log,
|
||||
slogecho.Config{
|
||||
WithTraceID: false, // done by logger already
|
||||
Filters: ek.logFilters,
|
||||
},
|
||||
))
|
||||
logConfig := slogecho.DefaultConfig()
|
||||
logConfig.WithTraceID = false // done by logger already
|
||||
logConfig.Filters = ek.logFilters
|
||||
e.Use(slogecho.NewWithConfig(log, logConfig))
|
||||
|
||||
if ek.prom != nil {
|
||||
e.Use(echoprometheus.NewMiddlewareWithConfig(echoprometheus.MiddlewareConfig{
|
||||
|
||||
Reference in New Issue
Block a user