Skip to content

Commit

Permalink
Add capability to set loglevel to trace during runtime
Browse files Browse the repository at this point in the history
Signed-off-by: Arpad Kiss <[email protected]>
  • Loading branch information
arp-est committed Oct 1, 2024
1 parent bb37edc commit bc6cb95
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ func main() {
logrus.SetLevel(level)
log.EnableTracing(true)
log.FromContext(ctx).WithField("duration", time.Since(now)).Infof("completed phase 1: get config from environment")
if level != logrus.TraceLevel {
logruslogger.SetupLevelChangeOnSignal(ctx, map[os.Signal]logrus.Level{
syscall.SIGUSR1: logrus.TraceLevel,
syscall.SIGUSR2: level,
})
}

// ********************************************************************************
// Configure Open Telemetry
Expand Down

0 comments on commit bc6cb95

Please sign in to comment.