log.c revision 0cfb24736841b3e98bb25853229a0efabab88bdd
862015b91f4426956b75db57aafb26b6eb0587ffMark Andrews/*
862015b91f4426956b75db57aafb26b6eb0587ffMark Andrews * Copyright (C) 2004-2007, 2009, 2011-2014 Internet Systems Consortium, Inc. ("ISC")
f9adb48aeade1ce6a815cf7fba57acac14861723Tinderbox User * Copyright (C) 1999-2001, 2003 Internet Software Consortium.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews *
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * Permission to use, copy, modify, and/or distribute this software for any
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * purpose with or without fee is hereby granted, provided that the above
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * copyright notice and this permission notice appear in all copies.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews *
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
862015b91f4426956b75db57aafb26b6eb0587ffMark Andrews */
89069e6b3abc5ab00c77227f31b771cc2fa4768fEvan Hunt
862015b91f4426956b75db57aafb26b6eb0587ffMark Andrews/* $Id: log.c,v 1.49 2011/10/13 22:48:24 tbox Exp $ */
862015b91f4426956b75db57aafb26b6eb0587ffMark Andrews
862015b91f4426956b75db57aafb26b6eb0587ffMark Andrews/*! \file */
862015b91f4426956b75db57aafb26b6eb0587ffMark Andrews
862015b91f4426956b75db57aafb26b6eb0587ffMark Andrews/* Principal Authors: DCL */
fb756ba3047770957173ba546257ca43af7ba3e4Mark Andrews
fb756ba3047770957173ba546257ca43af7ba3e4Mark Andrews#include <config.h>
fb756ba3047770957173ba546257ca43af7ba3e4Mark Andrews
26b49e84597ab3ebaa9ae1eb0fe01befa46a8107Mark Andrews#include <isc/util.h>
26b49e84597ab3ebaa9ae1eb0fe01befa46a8107Mark Andrews
fb604d1cee223986d090763292015309adfcf9c7Mark Andrews#include <dns/log.h>
fb604d1cee223986d090763292015309adfcf9c7Mark Andrews
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews/*%
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews * When adding a new category, be sure to add the appropriate
af903e500837935832e89e851f14cd4d51bcedf5Evan Hunt * \#define to <dns/log.h>.
89069e6b3abc5ab00c77227f31b771cc2fa4768fEvan Hunt */
0606c47750ad362909f010db2ef1ff8dcc96f9cbEvan HuntLIBDNS_EXTERNAL_DATA isc_logcategory_t dns_categories[] = {
af903e500837935832e89e851f14cd4d51bcedf5Evan Hunt { "notify", 0 },
b99bfa184bc9375421b5df915eea7dfac6a68a99Evan Hunt { "database", 0 },
{ "security", 0 },
{ "_placeholder", 0 },
{ "dnssec", 0 },
{ "resolver", 0 },
{ "xfer-in", 0 },
{ "xfer-out", 0 },
{ "dispatch", 0 },
{ "lame-servers", 0 },
{ "delegation-only", 0 },
{ "edns-disabled", 0 },
{ "rpz", 0 },
{ "rate-limit", 0 },
{ NULL, 0 }
};
/*%
* When adding a new module, be sure to add the appropriate
* \#define to <dns/log.h>.
*/
LIBDNS_EXTERNAL_DATA isc_logmodule_t dns_modules[] = {
{ "dns/db", 0 },
{ "dns/rbtdb", 0 },
{ "dns/rbtdb64", 0 },
{ "dns/rbt", 0 },
{ "dns/rdata", 0 },
{ "dns/master", 0 },
{ "dns/message", 0 },
{ "dns/cache", 0 },
{ "dns/config", 0 },
{ "dns/resolver", 0 },
{ "dns/zone", 0 },
{ "dns/journal", 0 },
{ "dns/adb", 0 },
{ "dns/xfrin", 0 },
{ "dns/xfrout", 0 },
{ "dns/acl", 0 },
{ "dns/validator", 0 },
{ "dns/dispatch", 0 },
{ "dns/request", 0 },
{ "dns/masterdump", 0 },
{ "dns/tsig", 0 },
{ "dns/tkey", 0 },
{ "dns/sdb", 0 },
{ "dns/diff", 0 },
{ "dns/hints", 0 },
{ "dns/acache", 0 },
{ "dns/dlz", 0 },
{ "dns/dnssec", 0 },
{ "dns/crypto", 0 },
{ "dns/packets", 0 },
{ "dns/nta", 0 },
{ NULL, 0 }
};
LIBDNS_EXTERNAL_DATA isc_log_t *dns_lctx = NULL;
void
dns_log_init(isc_log_t *lctx) {
REQUIRE(lctx != NULL);
isc_log_registercategories(lctx, dns_categories);
isc_log_registermodules(lctx, dns_modules);
}
void
dns_log_setcontext(isc_log_t *lctx) {
dns_lctx = lctx;
}