log.c revision 8f7cae3d7b0c122c3b17e8409bbb80005433acd2
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence/*
7d32c065c7bb56f281651ae3dd2888f32ce4f1d9Bob Halley * Copyright (C) 1999, 2000 Internet Software Consortium.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David 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.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence *
15a44745412679c30a6d022733925af70a38b715David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
15a44745412679c30a6d022733925af70a38b715David Lawrence * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
15a44745412679c30a6d022733925af70a38b715David Lawrence * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
15a44745412679c30a6d022733925af70a38b715David Lawrence * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
15a44745412679c30a6d022733925af70a38b715David Lawrence * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
15a44745412679c30a6d022733925af70a38b715David Lawrence * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
15a44745412679c30a6d022733925af70a38b715David Lawrence * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
15a44745412679c30a6d022733925af70a38b715David Lawrence * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence */
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence/* $Id: log.c,v 1.26 2000/08/01 01:22:28 tale Exp $ */
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence/* Principal Authors: DCL */
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
6b7257f756eb0530cdf54df9a7fab8d51a5001c3David Lawrence#include <config.h>
6b7257f756eb0530cdf54df9a7fab8d51a5001c3David Lawrence
364a82f7c25b62967678027043425201a5e5171aBob Halley#include <isc/util.h>
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence#include <dns/log.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 },
20c266cbc999c724e03e6edd437fb4181b92f095Michael Graff { "dispatch", 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 },
20c266cbc999c724e03e6edd437fb4181b92f095Michael Graff { "dns/dispatch", 0 },
29446b114946dbffc2e41eeeb1f0cce7d68f5198Andreas Gustafsson { "dns/request", 0 },
84fcfe530b60140f3f95f1d3894358d8c8ba4391Andreas Gustafsson { "dns/masterdump", 0 },
d4edcfe5eb6862ff4d5922e974e509d1f6cdf76fBrian Wellington { "dns/tsig", 0 },
d4edcfe5eb6862ff4d5922e974e509d1f6cdf76fBrian Wellington { "dns/tkey", 0 },
e9efde0ef217223a63c8060b5b53f9fdc4a8d6b0Bob Halley { NULL, 0 }
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence};
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
c90f5e8d1edbd5c277f2ee320167a12a30ba7c7bMichael Graffisc_log_t *dns_lctx = NULL;
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
edcd1247ad7e81bb8b430e610d9718f64c70f05dDavid Lawrencevoid
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrencedns_log_init(isc_log_t *lctx) {
c90f5e8d1edbd5c277f2ee320167a12a30ba7c7bMichael Graff REQUIRE(lctx != NULL);
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
edcd1247ad7e81bb8b430e610d9718f64c70f05dDavid Lawrence isc_log_registercategories(lctx, dns_categories);
edcd1247ad7e81bb8b430e610d9718f64c70f05dDavid Lawrence isc_log_registermodules(lctx, dns_modules);
c90f5e8d1edbd5c277f2ee320167a12a30ba7c7bMichael Graff}
c90f5e8d1edbd5c277f2ee320167a12a30ba7c7bMichael Graff
c90f5e8d1edbd5c277f2ee320167a12a30ba7c7bMichael Graffvoid
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrencedns_log_setcontext(isc_log_t *lctx) {
c90f5e8d1edbd5c277f2ee320167a12a30ba7c7bMichael Graff REQUIRE(dns_lctx == NULL);
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence
edcd1247ad7e81bb8b430e610d9718f64c70f05dDavid Lawrence dns_lctx = lctx;
fc80027fb54b501cdd88461bf879d078259e0226David Lawrence}