Add misc.extraLogging to enable log-queries=extra defaulting to false

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2023-12-01 12:20:29 +01:00
parent 2db977612c
commit 3a59b49df0
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD
5 changed files with 22 additions and 1 deletions

View File

@ -470,6 +470,8 @@ components:
type: array
items:
type: string
extraLogging:
type: boolean
check:
type: object
properties:
@ -712,6 +714,7 @@ components:
privacylevel: 0
etc_dnsmasq_d: false
dnsmasq_lines: [ ]
extraLogging: false
check:
load: true
shmem: 90

View File

@ -1105,6 +1105,12 @@ void initConfig(struct config *conf)
conf->misc.dnsmasq_lines.f = FLAG_ADVANCED_SETTING | FLAG_RESTART_FTL;
conf->misc.dnsmasq_lines.d.json = cJSON_CreateArray();
conf->misc.extraLogging.k = "misc.extraLogging";
conf->misc.extraLogging.h = "Log additional information about queries and replies to pihole.log\n When this setting is enabled, the log has extra information at the start of each line. This consists of a serial number which ties together the log lines associated with an individual query, and the IP address of the requestor. This setting is only effective if dns.queryLogging is enabled, too. This option is only useful for debugging and is not recommended for normal use.";
conf->misc.extraLogging.t = CONF_BOOL;
conf->misc.extraLogging.f = FLAG_RESTART_FTL;
conf->misc.extraLogging.d.b = false;
// sub-struct misc.check
conf->misc.check.load.k = "misc.check.load";
conf->misc.check.load.h = "Pi-hole is very lightweight on resources. Nevertheless, this does not mean that you should run Pi-hole on a server that is otherwise extremely busy as queuing on the system can lead to unnecessary delays in DNS operation as the system becomes less and less usable as the system load increases because all resources are permanently in use. To account for this, FTL regularly checks the system load. To bring this to your attention, FTL warns about excessive load when the 15 minute system load average exceeds the number of cores.\n This check can be disabled with this setting.";

View File

@ -270,6 +270,7 @@ struct config {
struct conf_item addr2line;
struct conf_item etc_dnsmasq_d;
struct conf_item dnsmasq_lines;
struct conf_item extraLogging;
struct {
struct conf_item load;
struct conf_item shmem;

View File

@ -345,7 +345,10 @@ bool __attribute__((const)) write_dnsmasq_config(struct config *conf, bool test_
if(conf->dns.queryLogging.v.b)
{
fputs("# Enable query logging\n", pihole_conf);
fputs("log-queries\n", pihole_conf);
if(conf->misc.extraLogging.v.b)
fputs("#log-queries=extra\n", pihole_conf);
else
fputs("log-queries\n", pihole_conf);
fputs("log-async\n", pihole_conf);
fputs("\n", pihole_conf);
}

View File

@ -822,6 +822,14 @@
# Use this option with extra care.
dnsmasq_lines = []
# Log additional information about queries and replies to pihole.log
# When this setting is enabled, the log has extra information at the start of each
# line. This consists of a serial number which ties together the log lines associated
# with an individual query, and the IP address of the requestor. This setting is only
# effective if dns.queryLogging is enabled, too. This option is only useful for
# debugging and is not recommended for normal use.
extraLogging = false
[misc.check]
# Pi-hole is very lightweight on resources. Nevertheless, this does not mean that you
# should run Pi-hole on a server that is otherwise extremely busy as queuing on the