2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

the 'default_debug' log channel was not set up when

'category default' was present in the config file
This commit is contained in:
Andreas Gustafsson
2000-04-28 18:53:45 +00:00
parent b22879b057
commit a0f6cda5fd
5 changed files with 46 additions and 14 deletions

View File

@@ -1,3 +1,6 @@
129. [bug] The 'default_debug' log channel was not set up when
'category default' was present in the config file
128. [cleanup] <isc/dir.h> had ISC_LANG_BEGINDECLS instead of
ISC_LANG_ENDDECLS at end of header.

View File

@@ -48,7 +48,18 @@ isc_result_t
ns_log_init(void);
isc_result_t
ns_log_setdefaults(isc_logconfig_t *lcfg);
ns_log_setdefaultchannels(isc_logconfig_t *lcfg);
/*
* Set up logging channels according to the named defaults, which
* may differ from the logging library defaults. Currently,
* this just means setting up default_debug.
*/
isc_result_t
ns_log_setdefaultcategory(isc_logconfig_t *lcfg);
/*
* Set up "category default" to go to the right places.
*/
void
ns_log_shutdown(void);

View File

@@ -79,7 +79,10 @@ ns_log_init(void) {
isc_log_registermodules(ns_g_lctx, ns_g_modules);
dns_log_init(ns_g_lctx);
result = ns_log_setdefaults(lcfg);
result = ns_log_setdefaultchannels(lcfg);
if (result != ISC_R_SUCCESS)
goto cleanup;
result = ns_log_setdefaultcategory(lcfg);
if (result != ISC_R_SUCCESS)
goto cleanup;
@@ -92,7 +95,7 @@ ns_log_init(void) {
}
isc_result_t
ns_log_setdefaults(isc_logconfig_t *lcfg) {
ns_log_setdefaultchannels(isc_logconfig_t *lcfg) {
isc_result_t result;
isc_logdestination_t destination;
@@ -116,6 +119,21 @@ ns_log_setdefaults(isc_logconfig_t *lcfg) {
goto cleanup;
}
/*
* Set the initial debug level.
*/
isc_log_setdebuglevel(ns_g_lctx, ns_g_debuglevel);
result = ISC_R_SUCCESS;
cleanup:
return (result);
}
isc_result_t
ns_log_setdefaultcategory(isc_logconfig_t *lcfg) {
isc_result_t result;
result = isc_log_usechannel(lcfg, "default_syslog",
ISC_LOGCATEGORY_DEFAULT, NULL);
if (result != ISC_R_SUCCESS)
@@ -126,12 +144,7 @@ ns_log_setdefaults(isc_logconfig_t *lcfg) {
if (result != ISC_R_SUCCESS)
goto cleanup;
/*
* Set the initial debug level.
*/
isc_log_setdebuglevel(ns_g_lctx, ns_g_debuglevel);
return (ISC_R_SUCCESS);
result = ISC_R_SUCCESS;
cleanup:
return (result);

View File

@@ -150,6 +150,8 @@ ns_log_configure(isc_logconfig_t *lcctx, dns_c_logginglist_t *clog) {
dns_c_logcat_t *ccat;
isc_boolean_t default_set = ISC_FALSE;
CHECK(ns_log_setdefaultchannels(lcctx));
for (cchan = ISC_LIST_HEAD(clog->channels);
cchan != NULL;
cchan = ISC_LIST_NEXT(cchan, next)) {
@@ -166,7 +168,7 @@ ns_log_configure(isc_logconfig_t *lcctx, dns_c_logginglist_t *clog) {
}
if (! default_set)
CHECK(ns_log_setdefaults(lcctx));
CHECK(ns_log_setdefaultcategory(lcctx));
return (ISC_R_SUCCESS);

View File

@@ -1314,12 +1314,15 @@ load_configuration(const char *filename, ns_server_t *server,
"creating new logging configuration");
(void) dns_c_ctx_getlogging(cctx, &clog);
if (clog != NULL)
if (clog != NULL) {
CHECKM(ns_log_configure(logc, clog),
"configuring logging");
else
CHECKM(ns_log_setdefaults(logc),
"setting up default logging defaults");
} else {
CHECKM(ns_log_setdefaultchannels(logc),
"setting up default logging channels");
CHECKM(ns_log_setdefaultcategory(logc),
"setting up default 'category default'");
}
result = isc_logconfig_use(ns_g_lctx, logc);
if (result != ISC_R_SUCCESS) {