From: Colin Vidal Date: Wed, 5 Nov 2025 14:06:03 +0000 (+0100) Subject: add query ID to the query trace message X-Git-Tag: v9.21.16~58^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b93d5725b6c34028a1ffe4471ff973eafca4516;p=thirdparty%2Fbind9.git add query ID to the query trace message Adding the query ID to the query trace message. The log is now as the following (id is at the end): query client=0x7f75c5017000 thread=0x7f75c6dfe680(foo.fr/A): \ client attr:0x22300, query attr:0x700, restarts:0, \ origqname:foo.fr, timer:0, authdb:0, referral:0, id:21338 This should help debugging tests, in particular to quickly get a specific query from the logs. --- diff --git a/lib/ns/query.c b/lib/ns/query.c index 8733e0938de..3e7e37d56e5 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -5283,12 +5283,13 @@ query_trace(query_ctx_t *qctx) { snprintf(mbuf, sizeof(mbuf) - 1, "client attr:0x%x, query attr:0x%X, restarts:%u, " - "origqname:%s, timer:%d, authdb:%d, referral:%d", + "origqname:%s, timer:%d, authdb:%d, referral:%d, id:%hu", qctx->client->inner.attributes, qctx->client->query.attributes, qctx->client->query.restarts, qbuf, (int)qctx->client->query.timerset, (int)qctx->client->query.authdbset, - (int)qctx->client->query.isreferral); + (int)qctx->client->query.isreferral, + qctx->client->message->id); CCTRACE(ISC_LOG_DEBUG(3), mbuf); #else /* ifdef WANT_QUERYTRACE */ UNUSED(qctx);