summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTobias Bölz <[email protected]>2023-09-22 17:03:41 +0200
committerMathijs van Veluw <[email protected]>2023-10-21 17:14:03 +0200
commit66a7baa67cd6f86c247978167dec0a88d0e2ae1a (patch)
treef57db304022bece360454a240de87103bbeaf582 /src
parentff8db4fd78bd20c141481bf7de0374f1834f760d (diff)
downloadvaultwarden-66a7baa67cd6f86c247978167dec0a88d0e2ae1a.tar.gz
vaultwarden-66a7baa67cd6f86c247978167dec0a88d0e2ae1a.zip
Reopen log file on SIGHUP
Diffstat (limited to 'src')
-rw-r--r--src/main.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index c200cf12..52e14593 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -326,7 +326,16 @@ fn init_logging(level: log::LevelFilter) -> Result<(), fern::InitError> {
}
if let Some(log_file) = CONFIG.log_file() {
- logger = logger.chain(fern::log_file(log_file)?);
+ #[cfg(windows)]
+ {
+ logger = logger.chain(fern::log_file(log_file)?);
+ }
+ #[cfg(not(windows))]
+ {
+ const SIGHUP: i32 = 1;
+ let path = Path::new(&log_file);
+ logger = logger.chain(fern::log_reopen1(path, [SIGHUP])?);
+ }
}
#[cfg(not(windows))]