mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-11 16:17:39 +02:00
directory: add logging http client to help with debugging outbound http requests (#2385)
This commit is contained in:
parent
aa0e6872de
commit
ac8ae3ef5b
13 changed files with 110 additions and 20 deletions
|
@ -16,6 +16,7 @@ import (
|
|||
"github.com/rs/zerolog"
|
||||
"github.com/tomnomnom/linkheader"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/httputil"
|
||||
"github.com/pomerium/pomerium/internal/log"
|
||||
"github.com/pomerium/pomerium/pkg/grpc/directory"
|
||||
)
|
||||
|
@ -47,7 +48,10 @@ func WithServiceAccount(serviceAccount *ServiceAccount) Option {
|
|||
// WithHTTPClient sets the http client option.
|
||||
func WithHTTPClient(httpClient *http.Client) Option {
|
||||
return func(cfg *config) {
|
||||
cfg.httpClient = httpClient
|
||||
cfg.httpClient = httputil.NewLoggingClient(httpClient,
|
||||
func(evt *zerolog.Event) *zerolog.Event {
|
||||
return evt.Str("provider", "github")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue