#include <isc/task.h>
#include <isc/util.h>
+#include <dns/client.h>
#include <dns/db.h>
#include <dns/dnssec.h>
#include <dns/ds.h>
char msgbuf[2048];
static const char spaces[] = " *";
int depth = val->depth * 2;
+ const char *viewname, *sep1, *sep2;
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
if ((unsigned int) depth >= sizeof spaces)
depth = sizeof spaces - 1;
+ /*
+ * Log the view name unless it's:
+ * * "_default/IN" (which means there's only one view
+ * configured in the server), or
+ * * "_dnsclient/IN" (which means this is being called
+ * from an application using dns/client.c).
+ */
+ if (val->view->rdclass == dns_rdataclass_in &&
+ (strcmp(val->view->name, "_default") == 0 ||
+ strcmp(val->view->name, DNS_CLIENTVIEW_NAME) == 0))
+ {
+ sep1 = viewname = sep2 = "";
+ } else {
+ sep1 = "view ";
+ viewname = val->view->name;
+ sep2 = ": ";
+ }
+
if (val->event != NULL && val->event->name != NULL) {
char namebuf[DNS_NAME_FORMATSIZE];
char typebuf[DNS_RDATATYPE_FORMATSIZE];
dns_rdatatype_format(val->event->type, typebuf,
sizeof(typebuf));
isc_log_write(dns_lctx, category, module, level,
- "%.*svalidating %s/%s: %s", depth, spaces,
+ "%s%s%s%.*svalidating %s/%s: %s",
+ sep1, viewname, sep2, depth, spaces,
namebuf, typebuf, msgbuf);
} else {
isc_log_write(dns_lctx, category, module, level,
- "%.*svalidator @%p: %s", depth, spaces,
- val, msgbuf);
+ "%s%s%s%.*svalidator @%p: %s",
+ sep1, viewname, sep2, depth, spaces,
+ val, msgbuf);
}
}