log.c revision 1.4
1/*	$NetBSD: log.c,v 1.4 2020/05/24 19:46:23 christos Exp $	*/
2
3/*
4 * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 *
10 * See the COPYRIGHT file distributed with this work for additional
11 * information regarding copyright ownership.
12 */
13
14/*! \file */
15
16#include <isc/util.h>
17
18#include <dns/log.h>
19
20/*%
21 * When adding a new category, be sure to add the appropriate
22 * \#define to <dns/log.h>.
23 */
24LIBDNS_EXTERNAL_DATA isc_logcategory_t dns_categories[] = {
25	{ "notify", 0 },
26	{ "database", 0 },
27	{ "security", 0 },
28	{ "_placeholder", 0 },
29	{ "dnssec", 0 },
30	{ "resolver", 0 },
31	{ "xfer-in", 0 },
32	{ "xfer-out", 0 },
33	{ "dispatch", 0 },
34	{ "lame-servers", 0 },
35	{ "delegation-only", 0 },
36	{ "edns-disabled", 0 },
37	{ "rpz", 0 },
38	{ "rate-limit", 0 },
39	{ "cname", 0 },
40	{ "spill", 0 },
41	{ "dnstap", 0 },
42	{ "zoneload", 0 },
43	{ "nsid", 0 },
44	{ NULL, 0 }
45};
46
47/*%
48 * When adding a new module, be sure to add the appropriate
49 * \#define to <dns/log.h>.
50 */
51LIBDNS_EXTERNAL_DATA isc_logmodule_t dns_modules[] = {
52	{ "dns/db", 0 },	 { "dns/rbtdb", 0 },
53	{ "dns/rbt", 0 },	 { "dns/rdata", 0 },
54	{ "dns/master", 0 },	 { "dns/message", 0 },
55	{ "dns/cache", 0 },	 { "dns/config", 0 },
56	{ "dns/resolver", 0 },	 { "dns/zone", 0 },
57	{ "dns/journal", 0 },	 { "dns/adb", 0 },
58	{ "dns/xfrin", 0 },	 { "dns/xfrout", 0 },
59	{ "dns/acl", 0 },	 { "dns/validator", 0 },
60	{ "dns/dispatch", 0 },	 { "dns/request", 0 },
61	{ "dns/masterdump", 0 }, { "dns/tsig", 0 },
62	{ "dns/tkey", 0 },	 { "dns/sdb", 0 },
63	{ "dns/diff", 0 },	 { "dns/hints", 0 },
64	{ "dns/unused1", 0 },	 { "dns/dlz", 0 },
65	{ "dns/dnssec", 0 },	 { "dns/crypto", 0 },
66	{ "dns/packets", 0 },	 { "dns/nta", 0 },
67	{ "dns/dyndb", 0 },	 { "dns/dnstap", 0 },
68	{ "dns/ssu", 0 },	 { NULL, 0 }
69};
70
71LIBDNS_EXTERNAL_DATA isc_log_t *dns_lctx = NULL;
72
73void
74dns_log_init(isc_log_t *lctx) {
75	REQUIRE(lctx != NULL);
76
77	isc_log_registercategories(lctx, dns_categories);
78	isc_log_registermodules(lctx, dns_modules);
79}
80
81void
82dns_log_setcontext(isc_log_t *lctx) {
83	dns_lctx = lctx;
84}
85