Skip to content

Commit

Permalink
Merge pull request #407 from NLnetLabs/devel/tweak-verbosity-levels
Browse files Browse the repository at this point in the history
Tweaking logging verbosity levels
  • Loading branch information
wtoorop authored Dec 4, 2024
2 parents 8235913 + 749f33f commit 15367dd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 2 additions & 0 deletions dbcreate.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ namedb_write_zonefile(struct nsd* nsd, struct zone_options* zopt)
return;
}
zone->is_changed = 0;
VERBOSITY(3, (LOG_INFO, "zone %s written to file %s",
zone->opts->name, zfile));
/* fetch the mtime of the just created zonefile so we
* do not waste effort reading it back in */
if(!file_get_mtime(zfile, &mtime, &notexist)) {
Expand Down
6 changes: 6 additions & 0 deletions xfrd-tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,9 @@ xfrd_tcp_setup_write_packet(struct xfrd_tcp_pipeline* tp, xfrd_zone_type* zone)
DEBUG(DEBUG_XFRD,1, (LOG_INFO, "request full zone transfer "
"(AXFR) for %s to %s",
zone->apex_str, zone->master->ip_address_spec));
VERBOSITY(3, (LOG_INFO, "request full zone transfer "
"(AXFR) for %s to %s",
zone->apex_str, zone->master->ip_address_spec));

xfrd_setup_packet(tcp->packet, TYPE_AXFR, CLASS_IN, zone->apex,
zone->query_id, NULL);
Expand All @@ -1027,6 +1030,9 @@ xfrd_tcp_setup_write_packet(struct xfrd_tcp_pipeline* tp, xfrd_zone_type* zone)
DEBUG(DEBUG_XFRD,1, (LOG_INFO, "request incremental zone "
"transfer (IXFR) for %s to %s",
zone->apex_str, zone->master->ip_address_spec));
VERBOSITY(3, (LOG_INFO, "request incremental zone "
"transfer (IXFR) for %s to %s",
zone->apex_str, zone->master->ip_address_spec));

xfrd_setup_packet(tcp->packet, TYPE_IXFR, CLASS_IN, zone->apex,
zone->query_id, &apex_compress);
Expand Down
18 changes: 14 additions & 4 deletions xfrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2484,10 +2484,20 @@ xfrd_handle_received_xfr_packet(xfrd_zone_type* zone, buffer_type* packet)
zone->latest_xfr->msg_seq_nr,
buffer_begin(packet), buffer_limit(packet), xfrd->nsd,
zone->latest_xfr->xfrfilenumber);
VERBOSITY(3, (LOG_INFO,
"xfrd: zone %s written received XFR packet from %s with serial %u to "
"disk", zone->apex_str, zone->master->ip_address_spec,
(int)zone->latest_xfr->msg_new_serial));

if(verbosity < 4 || zone->latest_xfr->msg_seq_nr == 0)
; /* pass */

else if((verbosity >= 6)
|| (verbosity >= 5 && zone->latest_xfr->msg_seq_nr % 1000 == 0)
|| (verbosity >= 4 && zone->latest_xfr->msg_seq_nr % 10000 == 0)) {
VERBOSITY(4, (LOG_INFO,
"xfrd: zone %s written received XFR packet %u from %s "
"with serial %u to disk", zone->apex_str,
zone->latest_xfr->msg_seq_nr,
zone->master->ip_address_spec,
(int)zone->latest_xfr->msg_new_serial));
}
zone->latest_xfr->msg_seq_nr++;

xfrfile_size = xfrd_get_xfrfile_size(
Expand Down

0 comments on commit 15367dd

Please sign in to comment.