]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1537. [func] New option "querylog". If set specify whether query
authorMark Andrews <marka@isc.org>
Tue, 2 Mar 2004 01:15:00 +0000 (01:15 +0000)
committerMark Andrews <marka@isc.org>
Tue, 2 Mar 2004 01:15:00 +0000 (01:15 +0000)
                        logging is to be enabled or disabled at startup.

CHANGES
bin/named/server.c
doc/arm/Bv9ARM-book.xml
lib/isccfg/namedconf.c

diff --git a/CHANGES b/CHANGES
index f48e97eed2c55dee5ce04b67a38f0831bf2221a4..97120f6e8d2476a3de453efad416dd892a1fb551 100644 (file)
--- a/CHANGES
+++ b/CHANGES
 
 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]
index 682ff3b10d90331b573a0c947af8e08c99c0585e..1f32ebb5baf53aa1e7400e0e30561cccef08e8b4 100644 (file)
@@ -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 <config.h>
 
@@ -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;
+                               }
                        }
                }
        }
index 45243cd4455fc8a526d36dd31fbce0f6e4f05ab2..c61e41355aaf5b44f5b483d1a7799f944f72f8da 100644 (file)
@@ -2,7 +2,7 @@
 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
                "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd">
 
-<!-- File: $Id: Bv9ARM-book.xml,v 1.236 2004/02/27 05:10:41 marka Exp $ -->
+<!-- File: $Id: Bv9ARM-book.xml,v 1.237 2004/03/02 01:15:00 marka Exp $ -->
 
 <book>
 <title>BIND 9 Administrator Reference Manual</title>
@@ -2624,7 +2624,12 @@ the <command>null</command> channel.</para></entry>
 </row>
 <row rowsep = "0">
 <entry colname = "1"><para><command>queries</command></para></entry>
-<entry colname = "2"><para>Queries. Using the category <command>queries</command> will enable query logging.</para></entry>
+<entry colname = "2"><para>Specify where queries should be logged to.</para>
+<para>
+At startup, specifing the category <command>queries</command> will also
+enable query logging unless <command>querylog</command> option has been
+specified.
+</para></entry>
 </row>
 <row rowsep = "0">
 <entry colname = "1"><para><command>dispatch</command></para></entry>
@@ -2823,6 +2828,7 @@ statement in the <filename>named.conf</filename> file:</para>
     <optional> preferred-glue ( <replaceable>A</replaceable> | <replaceable>AAAA</replaceable> | <replaceable>NONE</replaceable> ); </optional>
     <optional> edns-udp-size <replaceable>number</replaceable>; </optional>
     <optional> root-delegation-only <optional> exclude { <replaceable>namelist</replaceable> } </optional> ; </optional>
+    <optional> querylog <replaceable>yes_or_no</replaceable> ; </optional>
 };
     <optional> disable-algorithms <replaceable>domain</replaceable> { <replaceable>algorithm</replaceable>; <optional> <replaceable>algorithm</replaceable>; </optional> }; </optional>
 </programlisting>
@@ -3338,6 +3344,14 @@ named behaves as if it does not support DNSSEC.
 The default is <userinput>no</userinput>.
 </para></listitem></varlistentry>
 
+<varlistentry><term><command>querylog</command></term>
+<listitem>
+<para>
+Specify whether query logging should be started when named start.
+If <command>querylog</command> is not specified then the query logging
+is determined by the presence of the logging category <command>queries<command>.
+</para></listitem></varlistentry>
+
 </variablelist>
 
 </sect3>
index f5caf218ec9ecfd9f8ac682f3704d25058b36a66..31b2144699c9240092e8497d971f3ab73ab6f44a 100644 (file)
@@ -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 <config.h>
 
@@ -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 },