New logger for the Traefik logs
This commit is contained in:
parent
27c02b5a56
commit
56f7515ecd
297 changed files with 2337 additions and 1934 deletions
|
@ -8,7 +8,7 @@ import (
|
|||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
"github.com/traefik/traefik/v2/pkg/log"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
func (s *Server) configureSignals() {
|
||||
|
@ -22,17 +22,13 @@ func (s *Server) listenSignals(ctx context.Context) {
|
|||
return
|
||||
case sig := <-s.signals:
|
||||
if sig == syscall.SIGUSR1 {
|
||||
log.WithoutContext().Infof("Closing and re-opening log files for rotation: %+v", sig)
|
||||
log.Info().Msgf("Closing and re-opening log files for rotation: %+v", sig)
|
||||
|
||||
if s.accessLoggerMiddleware != nil {
|
||||
if err := s.accessLoggerMiddleware.Rotate(); err != nil {
|
||||
log.WithoutContext().Errorf("Error rotating access log: %v", err)
|
||||
log.Error().Err(err).Msg("Error rotating access log")
|
||||
}
|
||||
}
|
||||
|
||||
if err := log.RotateFile(); err != nil {
|
||||
log.WithoutContext().Errorf("Error rotating traefik log: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue