From: Mark Andrews Date: Tue, 2 Mar 2004 01:15:00 +0000 (+0000) Subject: 1537. [func] New option "querylog". If set specify whether query X-Git-Tag: v9.4.0~83 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=7ad4d54f29c315cbcb241ca5fc12ba1e0744358b;p=thirdparty%2Fbind9.git 1537. [func] New option "querylog". If set specify whether query logging is to be enabled or disabled at startup. --- diff --git a/CHANGES b/CHANGES index f48e97eed2c..97120f6e8d2 100644 --- a/CHANGES +++ b/CHANGES @@ -130,7 +130,8 @@ 1538. [placeholder] rt9997 -1537. [placeholder] rt9989 +1537. [func] New option "querylog". If set specify whether query + logging is to be enabled or disabled at startup. 1536. [bug] Windows socket code failed to log a error description when returning ISC_R_UNEXPECTED. [RT #9998] diff --git a/bin/named/server.c b/bin/named/server.c index 682ff3b10d9..1f32ebb5baf 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.414 2004/02/27 20:41:42 marka Exp $ */ +/* $Id: server.c,v 1.415 2004/03/02 01:14:59 marka Exp $ */ #include @@ -2499,23 +2499,31 @@ load_configuration(const char *filename, ns_server_t *server, if (first_time) { cfg_obj_t *logobj = NULL; cfg_obj_t *categories = NULL; - (void)cfg_map_get(config, "logging", &logobj); - if (logobj != NULL) - (void)cfg_map_get(logobj, "category", &categories); - if (categories != NULL) { - cfg_listelt_t *element; - for (element = cfg_list_first(categories); - element != NULL; - element = cfg_list_next(element)) - { - cfg_obj_t *catobj; - char *str; - - obj = cfg_listelt_value(element); - catobj = cfg_tuple_get(obj, "name"); - str = cfg_obj_asstring(catobj); - if (strcasecmp(str, "queries") == 0) - server->log_queries = ISC_TRUE; + + obj = NULL; + if (ns_config_get(maps, "querylog", &obj) == ISC_R_SUCCESS) { + server->log_queries = cfg_obj_asboolean(obj); + } else { + + (void)cfg_map_get(config, "logging", &logobj); + if (logobj != NULL) + (void)cfg_map_get(logobj, "category", + &categories); + if (categories != NULL) { + cfg_listelt_t *element; + for (element = cfg_list_first(categories); + element != NULL; + element = cfg_list_next(element)) + { + cfg_obj_t *catobj; + char *str; + + obj = cfg_listelt_value(element); + catobj = cfg_tuple_get(obj, "name"); + str = cfg_obj_asstring(catobj); + if (strcasecmp(str, "queries") == 0) + server->log_queries = ISC_TRUE; + } } } } diff --git a/doc/arm/Bv9ARM-book.xml b/doc/arm/Bv9ARM-book.xml index 45243cd4455..c61e41355aa 100644 --- a/doc/arm/Bv9ARM-book.xml +++ b/doc/arm/Bv9ARM-book.xml @@ -2,7 +2,7 @@ - + BIND 9 Administrator Reference Manual @@ -2624,7 +2624,12 @@ the null channel. queries -Queries. Using the category queries will enable query logging. +Specify where queries should be logged to. + +At startup, specifing the category queries will also +enable query logging unless querylog option has been +specified. + dispatch @@ -2823,6 +2828,7 @@ statement in the named.conf file: preferred-glue ( A | AAAA | NONE ); edns-udp-size number; root-delegation-only exclude { namelist } ; + querylog yes_or_no ; }; disable-algorithms domain { algorithm; algorithm; }; @@ -3338,6 +3344,14 @@ named behaves as if it does not support DNSSEC. The default is no. +querylog + + +Specify whether query logging should be started when named start. +If querylog is not specified then the query logging +is determined by the presence of the logging category queries. + + diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c index f5caf218ec9..31b2144699c 100644 --- a/lib/isccfg/namedconf.c +++ b/lib/isccfg/namedconf.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: namedconf.c,v 1.27 2004/02/27 20:41:51 marka Exp $ */ +/* $Id: namedconf.c,v 1.28 2004/03/02 01:15:00 marka Exp $ */ #include @@ -596,6 +596,7 @@ options_clauses[] = { { "named-xfer", &cfg_type_qstring, CFG_CLAUSEFLAG_OBSOLETE }, { "pid-file", &cfg_type_qstringornone, 0 }, { "port", &cfg_type_uint32, 0 }, + { "querylog", &cfg_type_boolean, 0 }, { "recursing-file", &cfg_type_qstring, 0 }, { "random-device", &cfg_type_qstring, 0 }, { "recursive-clients", &cfg_type_uint32, 0 },