Move origin fields capture to service level

Co-authored-by: lbenguigui <lbenguigui@gmail.com>
This commit is contained in:
Romain 2023-09-27 15:22:06 +02:00 committed by GitHub
parent b786f58f80
commit b966215e6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 121 additions and 17 deletions

View file

@ -76,7 +76,7 @@ func (m *Manager) BuildHandlers(rootCtx context.Context, entryPoints []string, t
}
handlerWithAccessLog, err := alice.New(func(next http.Handler) (http.Handler, error) {
return accesslog.NewFieldHandler(next, log.EntryPointName, entryPointName, accesslog.AddOriginFields), nil
return accesslog.NewFieldHandler(next, log.EntryPointName, entryPointName, accesslog.InitServiceFields), nil
}).Then(handler)
if err != nil {
log.FromContext(ctx).Error(err)