commit 724190f2624846ff62aad2cfc640ee476df9a1c3
parent 6867d23ca2b7e4eda82712355c2a2b47009b6932
Author: pjsier <pjsier@gmail.com>
Date: Wed, 28 Dec 2022 18:30:25 -0600
Log message to stderr if LOG_FILE is not writable
Co-authored-by: Helmut K. C. Tessarek <tessarek@evermeet.cx>
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/config.rs b/src/config.rs
@@ -665,6 +665,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!(