if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED) &&
!zone_touched(zone))
{
- dns_zone_log(zone, ISC_LOG_DEBUG(1),
- "skipping load: master file "
- "older than last load");
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_DEBUG(1),
+ "skipping load: master file "
+ "older than last load");
result = DNS_R_UPTODATE;
goto cleanup;
}
}
if (dlzdb == NULL) {
- dns_zone_log(zone, ISC_LOG_ERROR,
- "DLZ %s does not exist or is set "
- "to 'search yes;'", zone->db_argv[1]);
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_ERROR,
+ "DLZ %s does not exist or is set "
+ "to 'search yes;'", zone->db_argv[1]);
result = ISC_R_NOTFOUND;
goto cleanup;
}
result = (*dlzdb->configure_callback)(zone->view,
dlzdb, zone);
if (result != ISC_R_SUCCESS)
- dns_zone_log(zone, ISC_LOG_ERROR,
- "DLZ configuration callback: %s",
- isc_result_totext(result));
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_ERROR,
+ "DLZ configuration callback: %s",
+ isc_result_totext(result));
}
goto cleanup;
}
if (zone->masterfile == NULL ||
!isc_file_exists(zone->masterfile)) {
if (zone->masterfile != NULL) {
- dns_zone_log(zone, ISC_LOG_DEBUG(1),
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_DEBUG(1),
"no master file");
}
zone->refreshtime = now;
}
}
- dns_zone_log(zone, ISC_LOG_DEBUG(1), "starting load");
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_DEBUG(1), "starting load");
result = dns_db_create(zone->mctx, zone->db_argv[0],
&zone->origin, (zone->type == dns_zone_stub) ?
&db);
if (result != ISC_R_SUCCESS) {
- dns_zone_log(zone, ISC_LOG_ERROR,
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD, ISC_LOG_ERROR,
"loading zone: creating database: %s",
isc_result_totext(result));
goto cleanup;
if (zone->type == dns_zone_master ||
(zone->type == dns_zone_redirect &&
zone->masters == NULL)) {
- dns_zone_log(zone, ISC_LOG_ERROR,
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_ERROR,
"loading zone: "
"no master file configured");
goto cleanup;
}
- dns_zone_log(zone, ISC_LOG_INFO, "loading zone: "
- "no master file configured: continuing");
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_INFO, "loading zone: "
+ "no master file configured: continuing");
}
}
(zone->type == dns_zone_redirect &&
zone->masters == NULL)) {
if (result == ISC_R_FILENOTFOUND)
- dns_zone_log(zone, ISC_LOG_DEBUG(1),
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_DEBUG(1),
"no master file");
else if (result != DNS_R_NOMASTERFILE)
- dns_zone_log(zone, ISC_LOG_ERROR,
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_ERROR,
"loading from master file %s "
"failed: %s",
zone->masterfile,
} else if (zone->type == dns_zone_master &&
inline_secure(zone) && result == ISC_R_FILENOTFOUND)
{
- dns_zone_log(zone, ISC_LOG_DEBUG(1),
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_DEBUG(1),
"no master file, requesting db");
maybe_send_secure(zone);
} else {
if (zone->type == dns_zone_key &&
result == ISC_R_FILENOTFOUND)
level = ISC_LOG_DEBUG(1);
- dns_zone_log(zone, level,
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD, level,
"loading from master file %s failed: %s",
zone->masterfile,
dns_result_totext(result));
goto cleanup;
}
- dns_zone_log(zone, ISC_LOG_DEBUG(2),
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD, ISC_LOG_DEBUG(2),
"number of nodes in database: %u",
dns_db_nodecount(db));
zone->journal);
if (result != ISC_R_SUCCESS && result != ISC_R_NOTFOUND &&
result != DNS_R_UPTODATE && result != DNS_R_NOJOURNAL &&
- result != ISC_R_RANGE) {
- dns_zone_log(zone, ISC_LOG_ERROR,
+ result != ISC_R_RANGE)
+ {
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_ERROR,
"journal rollforward failed: %s",
dns_result_totext(result));
goto cleanup;
}
if (result == ISC_R_NOTFOUND || result == ISC_R_RANGE) {
- dns_zone_log(zone, ISC_LOG_ERROR,
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_ERROR,
"journal rollforward failed: "
"journal out of sync with zone");
goto cleanup;
}
- dns_zone_log(zone, ISC_LOG_DEBUG(1),
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD, ISC_LOG_DEBUG(1),
"journal rollforward completed "
"successfully: %s",
dns_result_totext(result));
&refresh, &retry, &expire, &minimum,
&errors);
if (result != ISC_R_SUCCESS && zone->type != dns_zone_key) {
- dns_zone_log(zone, ISC_LOG_ERROR,
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD, ISC_LOG_ERROR,
"could not find NS and/or SOA records");
}
if (jserial != serial) {
if (!empty)
- dns_zone_log(zone, ISC_LOG_INFO,
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_INFO,
"journal file is out of date: "
"removing journal file");
if (remove(zone->journal) < 0 && errno != ENOENT) {
}
}
- dns_zone_log(zone, ISC_LOG_DEBUG(1), "loaded; checking validity");
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD, ISC_LOG_DEBUG(1),
+ "loaded; checking validity");
/*
* Master / Slave / Stub zones require both NS and SOA records at
case dns_zone_stub:
case dns_zone_redirect:
if (soacount != 1) {
- dns_zone_log(zone, ISC_LOG_ERROR,
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_ERROR,
"has %d SOA records", soacount);
result = DNS_R_BADZONE;
}
if (nscount == 0) {
- dns_zone_log(zone, ISC_LOG_ERROR,
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_ERROR,
"has no NS records");
result = DNS_R_BADZONE;
}
if (serial == oldserial &&
zone_unchanged(zone->db, db, zone->mctx)) {
- dns_zone_log(zone, ISC_LOG_INFO,
+ dns_zone_logc(zone,
+ DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_INFO,
"ixfr-from-differences: "
"unchanged");
return(ISC_R_SUCCESS);
serialmin = (oldserial + 1) & 0xffffffffU;
serialmax = (oldserial + 0x7fffffffU) &
0xffffffffU;
- dns_zone_log(zone, ISC_LOG_ERROR,
- "ixfr-from-differences: "
- "new serial (%u) out of range "
- "[%u - %u]", serial, serialmin,
- serialmax);
+ dns_zone_logc(zone,
+ DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_ERROR,
+ "ixfr-from-differences: "
+ "new serial (%u) out of range "
+ "[%u - %u]", serial, serialmin,
+ serialmax);
result = DNS_R_BADZONE;
goto cleanup;
} else if (!isc_serial_ge(serial, oldserial))
- dns_zone_log(zone, ISC_LOG_ERROR,
- "zone serial (%u/%u) has gone "
- "backwards", serial, oldserial);
+ dns_zone_logc(zone,
+ DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_ERROR,
+ "zone serial (%u/%u) has gone "
+ "backwards", serial, oldserial);
else if (serial == oldserial && !hasinclude &&
strcmp(zone->db_argv[0], "_builtin") != 0)
- dns_zone_log(zone, ISC_LOG_ERROR,
- "zone serial (%u) unchanged. "
- "zone may fail to transfer "
- "to slaves.", serial);
+ dns_zone_logc(zone,
+ DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_ERROR,
+ "zone serial (%u) unchanged. "
+ "zone may fail to transfer "
+ "to slaves.", serial);
}
if (zone->type == dns_zone_master &&
zone->sigresigninginterval < (3 * refresh) &&
dns_db_issecure(db))
{
- dns_zone_log(zone, ISC_LOG_WARNING,
- "sig-re-signing-interval less than "
- "3 * refresh.");
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_WARNING,
+ "sig-re-signing-interval less than "
+ "3 * refresh.");
}
zone->refresh = RANGE(refresh,
dns_name_format(name, namebuf, sizeof(namebuf));
dns_rdatatype_format(next.covers,
typebuf, sizeof(typebuf));
- dns_zone_log(zone, ISC_LOG_DEBUG(3),
- "next resign: %s/%s in %d seconds",
- namebuf, typebuf,
- next.resign - timenow -
- zone->sigresigninginterval);
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_DEBUG(3),
+ "next resign: %s/%s "
+ "in %d seconds", namebuf, typebuf,
+ next.resign - timenow -
+ zone->sigresigninginterval);
dns_rdataset_disassociate(&next);
} else
- dns_zone_log(zone, ISC_LOG_WARNING,
- "signed dynamic zone has no "
- "resign event scheduled");
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_WARNING,
+ "signed dynamic zone has no "
+ "resign event scheduled");
}
zone_settimer(zone, &now);
zone->nincludes++;
}
- if (! dns_db_ispersistent(db))
- dns_zone_log(zone, ISC_LOG_INFO, "loaded serial %u%s", serial,
- dns_db_issecure(db) ? " (DNSSEC signed)" : "");
+ if (! dns_db_ispersistent(db)) {
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_INFO, "loaded serial %u%s", serial,
+ dns_db_issecure(db) ? " (DNSSEC signed)" : "");
+ }
zone->loadtime = loadtime;
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_LOADPENDING);
} else if (zone->type == dns_zone_master ||
zone->type == dns_zone_redirect) {
if (!(inline_secure(zone) && result == ISC_R_FILENOTFOUND))
- dns_zone_log(zone, ISC_LOG_ERROR,
- "not loaded due to errors.");
+ dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD,
+ ISC_LOG_ERROR,
+ "not loaded due to errors.");
else if (zone->type == dns_zone_master)
result = ISC_R_SUCCESS;
}
void
dns_zone_logc(dns_zone_t *zone, isc_logcategory_t *category,
- int level, const char *fmt, ...) {
+ int level, const char *fmt, ...)
+{
va_list ap;
char message[4096];