summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorpjsier <[email protected]>2022-12-28 18:30:25 -0600
committerDaniel GarcĂ­a <[email protected]>2023-01-09 19:16:30 +0100
commitfd5f65733422b00fe95866c25786915d7b08fb40 (patch)
treea7e7a7ed0c46c09bddb381f361347d25ecf1239c /src/config.rs
parentda9605f2d2ec127c1a800d49b435df82f7e7af7a (diff)
downloadvaultwarden-fd5f65733422b00fe95866c25786915d7b08fb40.tar.gz
vaultwarden-fd5f65733422b00fe95866c25786915d7b08fb40.zip
Log message to stderr if LOG_FILE is not writable
Co-authored-by: Helmut K. C. Tessarek <[email protected]>
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 2dcc87e7..b21666f6 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -690,6 +690,12 @@ fn validate_config(cfg: &ConfigItems) -> Result<(), Error> {
}
}
+ if let Some(log_file) = &cfg.log_file {
+ if std::fs::OpenOptions::new().append(true).create(true).open(log_file).is_err() {
+ err!("Unable to write to log file", log_file);
+ }
+ }
+
let dom = cfg.domain.to_lowercase();
if !dom.starts_with("http://") && !dom.starts_with("https://") {
err!(