1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 20:35:25 +02:00

feat(logging): redirect the standard logger to Zerolog EE-4186 (#7702)

This commit is contained in:
andres-portainer 2022-09-19 15:39:43 -03:00 committed by GitHub
parent 70ce4e70d9
commit 0fac1f85f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()
}