Also honor misc.hide_connection_error in pihole.log

`FTL_connection_error()` writes the same event twice: through `log_connection_error()` into FTL.log and the message table, and through `my_syslog()` into pihole.log. Only the first one was gated, and the second is not subject to the five-second throttle, so the setting left the more frequent of the two lines in place.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER committed 2026-09-10 22:14:37 +02:00
1 parent 872097815a
commit 8eecffca85
1 file changed
+3 -2
+3 -2
View File
@@ -4349,8 +4349,9 @@ void FTL_connection_error(const char *reason, const union mysockaddr *addr, cons
// Log to FTL.log
log_debug(DEBUG_QUERIES, "Connection error (%s#%u, ID %d): %s (%s)%s", ip, port, id, reason, error, extra);
// Log to pihole.log
my_syslog(priority, "%s: %s", reason, error);
// Log to pihole.log (unless the user asked us to hide these warnings)
if(!config.misc.hide_connection_error.v.b)
my_syslog(priority, "%s: %s", reason, error);
// Add to Pi-hole diagnostics but do not add messages more often than
// once every five seconds to avoid hammering the database with errors