log.c revision 6b7257f756eb0530cdf54df9a7fab8d51a5001c3
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence/*
7d32c065c7bb56f281651ae3dd2888f32ce4f1d9Bob Halley * Copyright (C) 1999, 2000 Internet Software Consortium.
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence *
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * Permission to use, copy, modify, and distribute this software for any
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * purpose with or without fee is hereby granted, provided that the above
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * copyright notice and this permission notice appear in all copies.
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence *
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * SOFTWARE.
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence */
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
6b7257f756eb0530cdf54df9a7fab8d51a5001c3David Lawrence/* $Id: log.c,v 1.18 2000/04/28 02:08:00 tale Exp $ */
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence/* Principal Authors: DCL */
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
6b7257f756eb0530cdf54df9a7fab8d51a5001c3David Lawrence#include <config.h>
6b7257f756eb0530cdf54df9a7fab8d51a5001c3David Lawrence
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence#include <isc/assertions.h>
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence#include <isc/log.h>
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence#include <isc/result.h>
364a82f7c25b62967678027043425201a5e5171aBob Halley#include <isc/util.h>
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence#include <dns/log.h>
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence#include <dns/result.h>
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence/*
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * When adding a new category, be sure to add the appropriate
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * #define to <dns/log.h>.
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence */
fc80027fb54b501cdd88461bf879d078259e0226David Lawrenceisc_logcategory_t dns_categories[] = {
5fe5a0c02634eaadfcbc3528bf2c184557110a3bAndreas Gustafsson { "notify", 0 },
5fe5a0c02634eaadfcbc3528bf2c184557110a3bAndreas Gustafsson { "database", 0 },
5fe5a0c02634eaadfcbc3528bf2c184557110a3bAndreas Gustafsson { "security", 0 },
5fe5a0c02634eaadfcbc3528bf2c184557110a3bAndreas Gustafsson { "config", 0 },
230bc05e7e4a6ba7fa4ee396048ab669552dcbe2Andreas Gustafsson { "dnssec", 0 },
5fe5a0c02634eaadfcbc3528bf2c184557110a3bAndreas Gustafsson { "resolver", 0 },
5fe5a0c02634eaadfcbc3528bf2c184557110a3bAndreas Gustafsson { "xfer-in", 0 },
5fe5a0c02634eaadfcbc3528bf2c184557110a3bAndreas Gustafsson { "xfer-out", 0 },
5fe5a0c02634eaadfcbc3528bf2c184557110a3bAndreas Gustafsson { NULL, 0 }
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence};
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence/*
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * When adding a new module, be sure to add the appropriate
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence * #define to <dns/log.h>.
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence */
fc80027fb54b501cdd88461bf879d078259e0226David Lawrenceisc_logmodule_t dns_modules[] = {
e9efde0ef217223a63c8060b5b53f9fdc4a8d6b0Bob Halley { "dns/db", 0 },
230bc05e7e4a6ba7fa4ee396048ab669552dcbe2Andreas Gustafsson { "dns/rbtdb", 0 },
230bc05e7e4a6ba7fa4ee396048ab669552dcbe2Andreas Gustafsson { "dns/rbtdb64", 0 },
230bc05e7e4a6ba7fa4ee396048ab669552dcbe2Andreas Gustafsson { "dns/rbt", 0 },
e9efde0ef217223a63c8060b5b53f9fdc4a8d6b0Bob Halley { "dns/rdata", 0 },
e9efde0ef217223a63c8060b5b53f9fdc4a8d6b0Bob Halley { "dns/master", 0 },
e9efde0ef217223a63c8060b5b53f9fdc4a8d6b0Bob Halley { "dns/message", 0 },
e9efde0ef217223a63c8060b5b53f9fdc4a8d6b0Bob Halley { "dns/cache", 0 },
e9efde0ef217223a63c8060b5b53f9fdc4a8d6b0Bob Halley { "dns/config", 0 },
e9efde0ef217223a63c8060b5b53f9fdc4a8d6b0Bob Halley { "dns/resolver", 0 },
70f6053bd1c18f0a0ebe5b52c8ddbf464e92a1c5Mark Andrews { "dns/zone", 0 },
61ba96e2f90930c7dfde73e05ac6d2c5a611afa7Andreas Gustafsson { "dns/journal", 0 },
09f041a8dfac8efa21eed2d8a28a56b3d3de0f6aMichael Graff { "dns/adb", 0 },
81ae5e1ae678320e46342d4bbb71bfb81227a248Andreas Gustafsson { "dns/xfrin", 0 },
81ae5e1ae678320e46342d4bbb71bfb81227a248Andreas Gustafsson { "dns/xfrout", 0 },
230bc05e7e4a6ba7fa4ee396048ab669552dcbe2Andreas Gustafsson { "dns/acl", 0 },
230bc05e7e4a6ba7fa4ee396048ab669552dcbe2Andreas Gustafsson { "dns/validator", 0 },
e9efde0ef217223a63c8060b5b53f9fdc4a8d6b0Bob Halley { NULL, 0 }
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence};
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
fc80027fb54b501cdd88461bf879d078259e0226David Lawrenceisc_log_t *dns_lctx;
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
edcd1247ad7e81bb8b430e610d9718f64c70f05dDavid Lawrencevoid
fc80027fb54b501cdd88461bf879d078259e0226David Lawrencedns_log_init(isc_log_t *lctx) {
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence REQUIRE(dns_lctx == NULL);
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
edcd1247ad7e81bb8b430e610d9718f64c70f05dDavid Lawrence isc_log_registercategories(lctx, dns_categories);
edcd1247ad7e81bb8b430e610d9718f64c70f05dDavid Lawrence isc_log_registermodules(lctx, dns_modules);
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
edcd1247ad7e81bb8b430e610d9718f64c70f05dDavid Lawrence dns_lctx = lctx;
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence}