New logger for the Traefik logs
This commit is contained in:
parent
27c02b5a56
commit
56f7515ecd
297 changed files with 2337 additions and 1934 deletions
|
@ -6,8 +6,8 @@ import (
|
|||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/traefik/traefik/v2/pkg/config/dynamic"
|
||||
"github.com/traefik/traefik/v2/pkg/log"
|
||||
"github.com/traefik/traefik/v2/pkg/provider"
|
||||
"github.com/traefik/traefik/v2/pkg/safe"
|
||||
"github.com/unrolled/render"
|
||||
|
@ -48,14 +48,14 @@ func (p *Provider) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
|||
configuration := new(dynamic.Configuration)
|
||||
|
||||
if err := json.NewDecoder(req.Body).Decode(configuration); err != nil {
|
||||
log.WithoutContext().Errorf("Error parsing configuration %+v", err)
|
||||
log.Error().Err(err).Msg("Error parsing configuration")
|
||||
http.Error(rw, fmt.Sprintf("%+v", err), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
p.configurationChan <- dynamic.Message{ProviderName: "rest", Configuration: configuration}
|
||||
if err := templatesRenderer.JSON(rw, http.StatusOK, configuration); err != nil {
|
||||
log.WithoutContext().Error(err)
|
||||
log.Error().Err(err).Send()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue