+3201. [func] 'rndc querylog' can now be given an on/off parameter
+ instead of only being used as a toggle. [RT #18351]
+
3200. [doc] Some rndc functions were undocumented or were
missing from 'rndc -h' output. [RT #25555]
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: control.c,v 1.46 2011/10/28 06:20:04 each Exp $ */
+/* $Id: control.c,v 1.47 2011/11/03 23:05:30 each Exp $ */
/*! \file */
} else if (command_compare(command, NS_COMMAND_DUMPSTATS)) {
result = ns_server_dumpstats(ns_g_server);
} else if (command_compare(command, NS_COMMAND_QUERYLOG)) {
- result = ns_server_togglequerylog(ns_g_server);
+ result = ns_server_togglequerylog(ns_g_server, command);
} else if (command_compare(command, NS_COMMAND_DUMPDB)) {
ns_server_dumpdb(ns_g_server, command);
result = ISC_R_SUCCESS;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: server.h,v 1.115 2011/10/28 06:20:04 each Exp $ */
+/* $Id: server.h,v 1.116 2011/11/03 23:05:30 each Exp $ */
#ifndef NAMED_SERVER_H
#define NAMED_SERVER_H 1
*/
isc_result_t
-ns_server_togglequerylog(ns_server_t *server);
+ns_server_togglequerylog(ns_server_t *server, char *args);
/*%<
- * Toggle logging of queries, as in BIND 8.
+ * Enable/disable logging of queries. (Takes "yes" or "no" argument,
+ * but can also be used as a toggle for backward comptibility.)
*/
/*%
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: server.c,v 1.626 2011/10/29 06:22:51 marka Exp $ */
+/* $Id: server.c,v 1.627 2011/11/03 23:05:30 each Exp $ */
/*! \file */
}
isc_result_t
-ns_server_togglequerylog(ns_server_t *server) {
- server->log_queries = server->log_queries ? ISC_FALSE : ISC_TRUE;
+ns_server_togglequerylog(ns_server_t *server, char *args) {
+ isc_boolean_t value;
+ char *ptr;
+
+ /* Skip the command name. */
+ ptr = next_token(&args, " \t");
+ if (ptr == NULL)
+ return (ISC_R_UNEXPECTEDEND);
+ ptr = next_token(&args, " \t");
+ if (ptr == NULL)
+ value = server->log_queries ? ISC_FALSE : ISC_TRUE;
+ else if (strcasecmp(ptr, "yes") == 0 || strcasecmp(ptr, "on") == 0)
+ value = ISC_TRUE;
+ else if (strcasecmp(ptr, "no") == 0 || strcasecmp(ptr, "off") == 0)
+ value = ISC_FALSE;
+ else
+ return (ISC_R_NOTFOUND);
+
+ if (server->log_queries == value)
+ return (ISC_R_SUCCESS);
+
+ server->log_queries = value;
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_SERVER, ISC_LOG_INFO,
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rndc.c,v 1.137 2011/11/03 22:06:21 each Exp $ */
+/* $Id: rndc.c,v 1.138 2011/11/03 23:05:30 each Exp $ */
/*! \file */
loadkeys zone [class [view]]\n\
Update keys without signing immediately.\n\
stats Write server statistics to the statistics file.\n\
- querylog Toggle query logging.\n\
+ querylog newstate\n\
+ Enable / disable query logging.\n\
dumpdb [-all|-cache|-zones] [view ...]\n\
Dump cache(s) to the dump file (named_dump.db).\n\
secroots [view ...]\n\
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- File: $Id: Bv9ARM-book.xml,v 1.512 2011/11/03 22:06:21 each Exp $ -->
+<!-- File: $Id: Bv9ARM-book.xml,v 1.513 2011/11/03 23:05:31 each Exp $ -->
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<title>BIND 9 Administrator Reference Manual</title>
</varlistentry>
<varlistentry>
- <term><userinput>querylog</userinput></term>
+ <term><userinput>querylog</userinput>
+ <optional>on|off</optional>
<listitem>
<para>
- Toggle query logging. Query logging can also be enabled
+ Enable or disable query logging. (For backward
+ compatibility, this command can also be used without
+ an argument to toggle query logging on and off.)
+ </para>
+ <para>
+ Query logging can also be enabled
by explicitly directing the <command>queries</command>
<command>category</command> to a
<command>channel</command> in the