mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-27 01:55:32 +03:00
resolved: upgrade log level to LOG_NOTICE if we switch to fallback server (or back)
This is inspired by a recent thread on fedora-devel: it's noteworthy when we switch to the fallback servers, since it might (or might not) indicate some configuration problem. Fixes: #18788
This commit is contained in:
parent
390e67305d
commit
9b564bbca5
@ -867,10 +867,11 @@ DnsServer *manager_set_dns_server(Manager *m, DnsServer *s) {
|
||||
if (m->current_dns_server == s)
|
||||
return s;
|
||||
|
||||
/* Let's log about the server switch, at debug level. Except if we switch from a non-fallback server
|
||||
* to a fallback server or back, since that is noteworthy and possibly a configuration issue */
|
||||
if (s)
|
||||
log_debug("Switching to %s DNS server %s.",
|
||||
dns_server_type_to_string(s->type),
|
||||
strna(dns_server_string_full(s)));
|
||||
log_full((s->type == DNS_SERVER_FALLBACK) != (m->current_dns_server && m->current_dns_server->type == DNS_SERVER_FALLBACK) ? LOG_NOTICE : LOG_DEBUG,
|
||||
"Switching to %s DNS server %s.", dns_server_type_to_string(s->type), strna(dns_server_string_full(s)));
|
||||
|
||||
dns_server_unref(m->current_dns_server);
|
||||
m->current_dns_server = dns_server_ref(s);
|
||||
|
Loading…
Reference in New Issue
Block a user