diff options
author | zeripath <art27@cantab.net> | 2020-07-06 01:07:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-05 20:07:07 -0400 |
commit | c5b08f6d5a73e6ba84da84e804d05a8dd3d651be (patch) | |
tree | 7e0f72b9c62b8764d000614714c91a01ebbee223 /modules/graceful/manager_unix.go | |
parent | 38fb087d1983ca8320fb1a8c90150ae7956b358d (diff) | |
download | gitea-c5b08f6d5a73e6ba84da84e804d05a8dd3d651be.tar.gz gitea-c5b08f6d5a73e6ba84da84e804d05a8dd3d651be.zip |
Pause, Resume, Release&Reopen, Add and Remove Logging from command line (#11777)
* Make LogDescriptions race safe
* Add manager commands for pausing, resuming, adding and removing loggers
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Placate lint
* Ensure that file logger is run!
* Add support for smtp and conn
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add release-and-reopen
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/graceful/manager_unix.go')
-rw-r--r-- | modules/graceful/manager_unix.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/graceful/manager_unix.go b/modules/graceful/manager_unix.go index d56a4558b7..540974454c 100644 --- a/modules/graceful/manager_unix.go +++ b/modules/graceful/manager_unix.go @@ -113,7 +113,10 @@ func (g *Manager) handleSignals(ctx context.Context) { log.Info("PID: %d. Received SIGHUP. Attempting GracefulRestart...", pid) g.DoGracefulRestart() case syscall.SIGUSR1: - log.Info("PID %d. Received SIGUSR1.", pid) + log.Warn("PID %d. Received SIGUSR1. Releasing and reopening logs", pid) + if err := log.ReleaseReopen(); err != nil { + log.Error("Error whilst releasing and reopening logs: %v", err) + } case syscall.SIGUSR2: log.Warn("PID %d. Received SIGUSR2. Hammering...", pid) g.DoImmediateHammer() |