From 7917f622993fa2edfff1221b51c0b649bbe29ddc Mon Sep 17 00:00:00 2001 From: Arpad Kiss Date: Wed, 9 Oct 2024 15:25:54 +0200 Subject: [PATCH] Add capability to set loglevel to trace during runtime Signed-off-by: Arpad Kiss --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index c8aa49e..e6bc0f8 100644 --- a/main.go +++ b/main.go @@ -108,6 +108,10 @@ func main() { logrus.Fatalf("invalid log level %s", config.LogLevel) } logrus.SetLevel(l) + logruslogger.SetupLevelChangeOnSignal(ctx, map[os.Signal]logrus.Level{ + syscall.SIGUSR1: logrus.TraceLevel, + syscall.SIGUSR2: l, + }) log.FromContext(ctx).Infof("Config: %#v", config)