mirror of https://github.com/portainer/portainer
feat(logging): redirect the standard logger to Zerolog EE-4186 (#7702)
parent
70ce4e70d9
commit
0fac1f85f7
|
@ -1,6 +1,8 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
stdlog "log"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/rs/zerolog/pkgerrors"
|
||||
|
@ -11,6 +13,9 @@ func configureLogger() {
|
|||
zerolog.ErrorStackMarshaler = pkgerrors.MarshalStack
|
||||
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
|
||||
|
||||
stdlog.SetFlags(0)
|
||||
stdlog.SetOutput(log.Logger)
|
||||
|
||||
log.Logger = log.Logger.With().Caller().Stack().Logger()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue