Added SIGHUP handler for logger file reopening.
This commit is contained in:
parent
ec06099d89
commit
6dbe154bbc
@ -65,6 +65,18 @@ func main() {
|
||||
logErr.Fatalln(err)
|
||||
}
|
||||
|
||||
logReload := make(chan os.Signal, 1)
|
||||
signal.Notify(logReload, syscall.SIGHUP)
|
||||
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case <-logReload:
|
||||
logErr.Reopen(config.Log.Error)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
doneSignal := make(chan os.Signal, 1)
|
||||
signal.Notify(doneSignal, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user