839. [func] Dump packets for which there was no view or that the
- class could not be determined to file, (-e filename).
+ class could not be determined to category "unmatched".
838. [port] UnixWare 7.x.x is now suported by
bin/tests/system/ifconfig.sh.
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: client.c,v 1.168 2001/05/25 07:39:45 marka Exp $ */
+/* $Id: client.c,v 1.169 2001/05/28 05:16:54 marka Exp $ */
#include <config.h>
(void)snprintf(buf, len, "%s '%s/%s'", msg, namebuf, classbuf);
}
-static isc_mutex_t dumpmessagemutex;
-
-static void dumpmessagemutex_init(void) {
- (void)isc_mutex_init(&dumpmessagemutex);
-}
-
static void
ns_client_dumpmessage(ns_client_t *client, const char *reason) {
- static isc_once_t once = ISC_ONCE_INIT;
- char peerbuf[ISC_SOCKADDR_FORMATSIZE];
isc_buffer_t buffer;
char *buf = NULL;
int len = 1024;
isc_result_t result;
- FILE *fd = NULL;
-
- if (ns_g_examinelog == NULL)
- return;
- ns_client_name(client, peerbuf, sizeof(peerbuf));
-
- isc_once_do(&once, dumpmessagemutex_init);
-
- LOCK(&dumpmessagemutex);
-
- result = isc_stdio_open(ns_g_examinelog, "a", &fd);
- if (result != ISC_R_SUCCESS)
- goto unlock;
+ /*
+ * Note these a multiline debug messages. We want a newline
+ * to appear in the log after each message.
+ */
do {
buf = isc_mem_get(client->mctx, len);
isc_mem_put(client->mctx, buf, len);
len += 1024;
} else if (result == ISC_R_SUCCESS)
- fprintf(fd, "\nclient %s: %s\n%.*s\n", peerbuf, reason,
- (int)isc_buffer_usedlength(&buffer), buf);
+ ns_client_log(client, NS_LOGCATEGORY_UNMATCHED,
+ NS_LOGMODULE_CLIENT, ISC_LOG_INFO,
+ "%s\n%.*s", reason,
+ (int)isc_buffer_usedlength(&buffer),
+ buf);
} while (result == ISC_R_NOSPACE);
if (buf != NULL)
isc_mem_put(client->mctx, buf, len);
- (void)isc_stdio_close(fd);
- unlock:
- UNLOCK(&dumpmessagemutex);
}
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: globals.h,v 1.55 2001/05/25 07:39:48 marka Exp $ */
+/* $Id: globals.h,v 1.56 2001/05/28 05:17:01 marka Exp $ */
#ifndef NAMED_GLOBALS_H
#define NAMED_GLOBALS_H 1
EXTERN const char * lwresd_g_defaultpidfile INIT(NS_LOCALSTATEDIR
"/run/lwresd.pid");
EXTERN const char * ns_g_username INIT(NULL);
-EXTERN const char * ns_g_examinelog INIT(NULL);
#undef EXTERN
#undef INIT
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: log.h,v 1.18 2001/03/27 00:44:38 bwelling Exp $ */
+/* $Id: log.h,v 1.19 2001/05/28 05:17:02 marka Exp $ */
#ifndef NAMED_LOG_H
#define NAMED_LOG_H 1
#define NS_LOGCATEGORY_NETWORK (&ns_g_categories[2])
#define NS_LOGCATEGORY_UPDATE (&ns_g_categories[3])
#define NS_LOGCATEGORY_QUERIES (&ns_g_categories[4])
+#define NS_LOGCATEGORY_UNMATCHED (&ns_g_categories[5])
/*
* Backwards compatibility.
* Set up "category default" to go to the right places.
*/
+isc_result_t
+ns_log_setunmatchedcategory(isc_logconfig_t *lcfg);
+/*
+ * Set up "category unmatched" to go to the right places.
+ */
+
void
ns_log_shutdown(void);
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: log.c,v 1.31 2001/03/27 00:44:31 bwelling Exp $ */
+/* $Id: log.c,v 1.32 2001/05/28 05:16:55 marka Exp $ */
#include <config.h>
{ "network", 0 },
{ "update", 0 },
{ "queries", 0 },
+ { "unmatched", 0 },
{ NULL, 0 }
};
return (result);
}
+isc_result_t
+ns_log_setunmatchedcategory(isc_logconfig_t *lcfg) {
+ isc_result_t result;
+
+ result = isc_log_usechannel(lcfg, "null",
+ NS_LOGCATEGORY_UNMATCHED, NULL);
+ return (result);
+}
+
void
ns_log_shutdown(void) {
isc_log_destroy(&ns_g_lctx);
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: logconf.c,v 1.29 2001/04/26 02:38:08 tale Exp $ */
+/* $Id: logconf.c,v 1.30 2001/05/28 05:16:57 marka Exp $ */
#include <config.h>
cfg_obj_t *categories = NULL;
cfg_listelt_t *element;
isc_boolean_t default_set = ISC_FALSE;
+ isc_boolean_t unmatched_set = ISC_FALSE;
CHECK(ns_log_setdefaultchannels(logconf));
if (strcmp(cfg_obj_asstring(catname), "default"))
default_set = ISC_TRUE;
}
+ if (!unmatched_set) {
+ cfg_obj_t *catname = cfg_tuple_get(category, "name");
+ if (strcmp(cfg_obj_asstring(catname), "unmatched"))
+ unmatched_set = ISC_TRUE;
+ }
}
if (!default_set)
CHECK(ns_log_setdefaultcategory(logconf));
+ if (!unmatched_set)
+ CHECK(ns_log_setunmatchedcategory(logconf));
+
return (ISC_R_SUCCESS);
cleanup:
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: main.c,v 1.110 2001/05/25 07:39:46 marka Exp $ */
+/* $Id: main.c,v 1.111 2001/05/28 05:16:58 marka Exp $ */
#include <config.h>
isc_commandline_errprint = ISC_FALSE;
while ((ch = isc_commandline_parse(argc, argv,
- "c:C:d:e:fgi:ln:N:p:P:st:u:vx:")) !=
+ "c:C:d:fgi:ln:N:p:P:st:u:vx:")) !=
-1) {
switch (ch) {
case 'c':
ns_g_debuglevel = parse_int(isc_commandline_argument,
"debug level");
break;
- case 'e':
- ns_g_examinelog = isc_commandline_argument;
- break;
case 'f':
ns_g_foreground = ISC_TRUE;
break;
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: server.c,v 1.326 2001/05/14 20:44:10 bwelling Exp $ */
+/* $Id: server.c,v 1.327 2001/05/28 05:17:00 marka Exp $ */
#include <config.h>
} else {
CHECKM(ns_log_setdefaultchannels(logc),
"setting up default logging channels");
+ CHECKM(ns_log_setunmatchedcategory(logc),
+ "setting up default 'category unmatched'");
CHECKM(ns_log_setdefaultcategory(logc),
"setting up default 'category default'");
}
<!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.135 2001/05/19 00:07:33 gson Exp $ -->
+<!-- File: $Id: Bv9ARM-book.xml,v 1.136 2001/05/28 05:17:05 marka Exp $ -->
<book>
<title>BIND 9 Administrator Reference Manual</title>
the logging configuration will be:</para>
<programlisting>logging {
+ category "unmatched" { "null"; };
category "default" { "default_syslog"; "default_debug"; };
};
</programlisting>
<entry colname = "2"><para>Processing of client requests.</para></entry>
</row>
<row rowsep = "0">
+<entry colname = "1"><para><command>unmatched</command></para></entry>
+<entry colname = "2"><para>Messages that named was unable to determine the
+class of or for which there was no matching <command>view</command>.
+A one line summary is also logged to the <command>client</command> category.
+This category is best sent to a file or stderr, by default it is sent to
+the <command>null</command> channel.</para></entry>
+</row>
+<row rowsep = "0">
<entry colname = "1"><para><command>network</command></para></entry>
<entry colname = "2"><para>Network operations.</para></entry>
</row>