init_error_log(): Include the reason for failures to open the log file
authorFabian Keil <fk@fabiankeil.de>
Fri, 6 Sep 2024 11:41:22 +0000 (13:41 +0200)
committerFabian Keil <fk@fabiankeil.de>
Thu, 10 Oct 2024 04:49:05 +0000 (06:49 +0200)
errlog.c

index 3446b72..da6af45 100644 (file)
--- a/errlog.c
+++ b/errlog.c
@@ -339,7 +339,7 @@ void init_error_log(const char *prog_name, const char *logfname)
        * reopen it if the file name changed or if the
        * configuration reload was caused by a SIGHUP.
        */
-      log_error(LOG_LEVEL_INFO, "Failed to reopen logfile: \'%s\'. "
+      log_error(LOG_LEVEL_INFO, "Failed to reopen logfile: \'%s\': %E. "
          "Retrying after closing the old file descriptor first. If that "
          "doesn't work, Privoxy will exit without being able to log a message.",
          logfname);
@@ -352,7 +352,8 @@ void init_error_log(const char *prog_name, const char *logfname)
 
    if (NULL == fp)
    {
-      log_error(LOG_LEVEL_FATAL, "init_error_log(): can't open logfile: \'%s\'", logfname);
+      log_error(LOG_LEVEL_FATAL,
+         "init_error_log(): can't open logfile \'%s\': %E", logfname);
    }
 
 #ifdef FEATURE_EXTERNAL_FILTERS