From fe7bdc9d29963f0d90c8392b6f2a994fac36f821 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 4 Nov 2020 17:15:28 +0100 Subject: [PATCH] proxy: also rotate auth.log file no need for triggering re-open here, we always re-open that file. Signed-off-by: Thomas Lamprecht --- src/bin/proxmox-backup-proxy.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs index 1ae94486..5803f024 100644 --- a/src/bin/proxmox-backup-proxy.rs +++ b/src/bin/proxmox-backup-proxy.rs @@ -581,11 +581,18 @@ async fn schedule_task_log_rotate() { let mut logrotate = LogRotate::new(buildcfg::API_ACCESS_LOG_FN, true) .ok_or_else(|| format_err!("could not get API access log file names"))?; - let has_rotated = logrotate.rotate(max_size, None, Some(max_files))?; - if has_rotated { + if logrotate.rotate(max_size, None, Some(max_files))? { println!("rotated access log, telling daemons to re-open log file"); proxmox_backup::tools::runtime::block_on(command_reopen_logfiles())?; + worker.log(format!("API access log was rotated")); + } else { + worker.log(format!("API access log was not rotated")); + } + let mut logrotate = LogRotate::new(buildcfg::API_AUTH_LOG_FN, true) + .ok_or_else(|| format_err!("could not get API auth log file names"))?; + + if logrotate.rotate(max_size, None, Some(max_files))? { worker.log(format!("API access log was rotated")); } else { worker.log(format!("API access log was not rotated"));