mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 01:09:36 +02:00
core/logging: change log.Error function (#5251)
* core/logging: change log.Error function * use request id
This commit is contained in:
parent
97bf5edc54
commit
dad954ae16
66 changed files with 163 additions and 166 deletions
|
@ -74,7 +74,7 @@ func (e *HTTPError) ErrorResponse(ctx context.Context, w http.ResponseWriter, r
|
|||
w.Header().Set(HeaderPomeriumResponse, "true")
|
||||
|
||||
if e.Status >= 400 {
|
||||
log.Error(ctx).
|
||||
log.Ctx(ctx).Error().
|
||||
Err(e.Err).
|
||||
Int("status", e.Status).
|
||||
Str("status-text", StatusText(e.Status)).
|
||||
|
|
|
@ -137,7 +137,7 @@ func (h *Handler) Update(ctx context.Context, cfg *config.Config) {
|
|||
for p := range cfg.Options.GetAllPolicies() {
|
||||
id, err := p.RouteID()
|
||||
if err != nil {
|
||||
log.Error(ctx).Err(err).Msg("reproxy: error getting route id")
|
||||
log.Ctx(ctx).Error().Err(err).Msg("reproxy: error getting route id")
|
||||
continue
|
||||
}
|
||||
h.policies[id] = p
|
||||
|
|
|
@ -99,6 +99,6 @@ func Shutdown(srv *http.Server) {
|
|||
defer cancel()
|
||||
log.Info(context.TODO()).Str("signal", rec.String()).Msg("internal/httputil: shutting down servers")
|
||||
if err := srv.Shutdown(ctx); err != nil {
|
||||
log.Error(context.TODO()).Err(err).Msg("internal/httputil: shutdown failed")
|
||||
log.Error().Err(err).Msg("internal/httputil: shutdown failed")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue