log.c revision 7d98a1783f222964bcde7d56dab77b822706204d
7d98a1783f222964bcde7d56dab77b822706204dBob Halley * Copyright (C) 1999, 2000 Internet Software Consortium.
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * Permission to use, copy, modify, and distribute this software for any
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * purpose with or without fee is hereby granted, provided that the above
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * copyright notice and this permission notice appear in all copies.
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * When adding a new category, be sure to add the appropriate
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * #define to <named/log.h>.
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley { "general", 0 },
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley { "client", 0 },
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley { "network", 0 },
8327c62a49a2487d29a37acbed6b602e629fc0eeAndreas Gustafsson { "update", 0 },
8327c62a49a2487d29a37acbed6b602e629fc0eeAndreas Gustafsson { "xfer-in", 0 },
8327c62a49a2487d29a37acbed6b602e629fc0eeAndreas Gustafsson { "xfer-out", 0 },
608f870f4821972313eadc5388a42fa55b6279d1Mark Andrews { "notify", 0 },
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * When adding a new module, be sure to add the appropriate
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * #define to <dns/log.h>.
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley { "main", 0 },
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley { "client", 0 },
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley { "server", 0 },
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley { "query", 0 },
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley { "interfacemgr", 0 },
8327c62a49a2487d29a37acbed6b602e629fc0eeAndreas Gustafsson { "update", 0 },
8327c62a49a2487d29a37acbed6b602e629fc0eeAndreas Gustafsson { "xfer-in", 0 },
8327c62a49a2487d29a37acbed6b602e629fc0eeAndreas Gustafsson { "xfer-out", 0 },
608f870f4821972313eadc5388a42fa55b6279d1Mark Andrews { "notify", 0 },
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley unsigned int flags;
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley * XXXRTH This is not necessarily the final default logging
8582a1e113c13886ccbd1b534d6c240315767be6Bob Halley * Setup a logging context.
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley result = isc_log_registercategories(ns_g_lctx, ns_g_categories);
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley isc_log_registermodules(ns_g_lctx, ns_g_modules);
8582a1e113c13886ccbd1b534d6c240315767be6Bob Halley * Create and install the default channel.
44fee668021c7ceef4ee1c848031d883a508b359James Brister destination.file.versions = ISC_LOG_ROLLNEVER;
44fee668021c7ceef4ee1c848031d883a508b359James Brister result = isc_log_createchannel(ns_g_lctx, "_default",
44fee668021c7ceef4ee1c848031d883a508b359James Brister result = isc_log_createchannel(ns_g_lctx, "_default",
1687985cdfc3a4c330c5bdb02c131835f8756e3cBob Halley result = isc_log_usechannel(ns_g_lctx, "_default", NULL, NULL);
8582a1e113c13886ccbd1b534d6c240315767be6Bob Halley * Set the initial debug level.