]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - contrib/bind9/bin/named/include/named/log.h
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / contrib / bind9 / bin / named / include / named / log.h
1 /*
2  * Copyright (C) 2004, 2005  Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (C) 1999-2002  Internet Software Consortium.
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15  * PERFORMANCE OF THIS SOFTWARE.
16  */
17
18 /* $Id: log.h,v 1.21.18.2 2005/04/29 00:15:35 marka Exp $ */
19
20 #ifndef NAMED_LOG_H
21 #define NAMED_LOG_H 1
22
23 /*! \file */
24
25 #include <isc/log.h>
26 #include <isc/types.h>
27
28 #include <dns/log.h>
29
30 #include <named/globals.h>      /* Required for ns_g_(categories|modules). */
31
32 /* Unused slot 0. */
33 #define NS_LOGCATEGORY_CLIENT           (&ns_g_categories[1])
34 #define NS_LOGCATEGORY_NETWORK          (&ns_g_categories[2])
35 #define NS_LOGCATEGORY_UPDATE           (&ns_g_categories[3])
36 #define NS_LOGCATEGORY_QUERIES          (&ns_g_categories[4])
37 #define NS_LOGCATEGORY_UNMATCHED        (&ns_g_categories[5])
38 #define NS_LOGCATEGORY_UPDATE_SECURITY  (&ns_g_categories[6])
39
40 /*
41  * Backwards compatibility.
42  */
43 #define NS_LOGCATEGORY_GENERAL          ISC_LOGCATEGORY_GENERAL
44
45 #define NS_LOGMODULE_MAIN               (&ns_g_modules[0])
46 #define NS_LOGMODULE_CLIENT             (&ns_g_modules[1])
47 #define NS_LOGMODULE_SERVER             (&ns_g_modules[2])
48 #define NS_LOGMODULE_QUERY              (&ns_g_modules[3])
49 #define NS_LOGMODULE_INTERFACEMGR       (&ns_g_modules[4])
50 #define NS_LOGMODULE_UPDATE             (&ns_g_modules[5])
51 #define NS_LOGMODULE_XFER_IN            (&ns_g_modules[6])
52 #define NS_LOGMODULE_XFER_OUT           (&ns_g_modules[7])
53 #define NS_LOGMODULE_NOTIFY             (&ns_g_modules[8])
54 #define NS_LOGMODULE_CONTROL            (&ns_g_modules[9])
55 #define NS_LOGMODULE_LWRESD             (&ns_g_modules[10])
56
57 isc_result_t
58 ns_log_init(isc_boolean_t safe);
59 /*%
60  * Initialize the logging system and set up an initial default
61  * logging default configuration that will be used until the
62  * config file has been read.
63  *
64  * If 'safe' is true, use a default configuration that refrains
65  * from opening files.  This is to avoid creating log files
66  * as root.
67  */
68
69 isc_result_t
70 ns_log_setdefaultchannels(isc_logconfig_t *lcfg);
71 /*%
72  * Set up logging channels according to the named defaults, which
73  * may differ from the logging library defaults.  Currently,
74  * this just means setting up default_debug.
75  */
76
77 isc_result_t
78 ns_log_setsafechannels(isc_logconfig_t *lcfg);
79 /*%
80  * Like ns_log_setdefaultchannels(), but omits any logging to files.
81  */
82
83 isc_result_t
84 ns_log_setdefaultcategory(isc_logconfig_t *lcfg);
85 /*%
86  * Set up "category default" to go to the right places.
87  */
88
89 isc_result_t
90 ns_log_setunmatchedcategory(isc_logconfig_t *lcfg);
91 /*%
92  * Set up "category unmatched" to go to the right places.
93  */
94
95 void
96 ns_log_shutdown(void);
97
98 #endif /* NAMED_LOG_H */