diff options
author | pjsier <[email protected]> | 2022-12-28 18:30:25 -0600 |
---|---|---|
committer | Daniel GarcĂa <[email protected]> | 2023-01-09 18:25:18 +0100 |
commit | 665e275dc52521217d31c5e4aa45103499e03cbd (patch) | |
tree | 51d5c80b16a63049919f2b7db64336e602cd4212 /src/config.rs | |
parent | a6da728ccaf9fe16eeab503220f33cf8a6eb9f0f (diff) | |
download | vaultwarden-665e275dc52521217d31c5e4aa45103499e03cbd.tar.gz vaultwarden-665e275dc52521217d31c5e4aa45103499e03cbd.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.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 173a1f6e..1b99cea0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -678,6 +678,12 @@ fn validate_config(cfg: &ConfigItems) -> Result<(), Error> { err!(format!("`DATABASE_MAX_CONNS` contains an invalid value. Ensure it is between 1 and {}.", limit,)); } + 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!( |