diff src/core/ngx_syslog.c @ 9224:c7c8354f99fa

Syslog: fixed duplicate errors with access logging to syslog. The ngx_syslog_send() function logs errors itself, so there is no need to additionally log errors in the caller, notably access log modules in http and stream. To ensure that incomplete and blocked writes are also logged, appropriate logging added to ngx_syslog_send().
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 01 Mar 2024 05:42:09 +0300
parents 8771d35d55d0
children 1c9264603adc
line wrap: on
line diff
--- a/src/core/ngx_syslog.c
+++ b/src/core/ngx_syslog.c
@@ -319,6 +319,10 @@ ngx_syslog_send(ngx_syslog_peer_t *peer,
         }
 
         peer->conn.fd = (ngx_socket_t) -1;
+
+    } else if ((size_t) n != len) {
+        ngx_log_error(NGX_LOG_CRIT, &peer->log, 0,
+                      "send() incomplete");
     }
 
     return n;