log.h 2.78 KB
Newer Older
Bob Halley's avatar
add  
Bob Halley committed
1
/*
Brian Wellington's avatar
Brian Wellington committed
2
 * Copyright (C) 1999-2001  Internet Software Consortium.
3
 *
Bob Halley's avatar
add  
Bob Halley committed
4 5 6
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
7
 *
8 9 10 11 12 13 14 15
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Bob Halley's avatar
add  
Bob Halley committed
16 17
 */

18
/* $Id: log.h,v 1.18 2001/03/27 00:44:38 bwelling Exp $ */
David Lawrence's avatar
David Lawrence committed
19

20 21
#ifndef NAMED_LOG_H
#define NAMED_LOG_H 1
Bob Halley's avatar
add  
Bob Halley committed
22 23

#include <isc/log.h>
24
#include <isc/types.h>
Bob Halley's avatar
add  
Bob Halley committed
25 26 27

#include <dns/log.h>

28
#include <named/globals.h>	/* Required for ns_g_(categories|modules). */
Bob Halley's avatar
add  
Bob Halley committed
29

30
/* Unused slot 0. */
Bob Halley's avatar
add  
Bob Halley committed
31 32
#define NS_LOGCATEGORY_CLIENT		(&ns_g_categories[1])
#define NS_LOGCATEGORY_NETWORK		(&ns_g_categories[2])
33
#define NS_LOGCATEGORY_UPDATE		(&ns_g_categories[3])
34
#define NS_LOGCATEGORY_QUERIES		(&ns_g_categories[4])
35

36 37 38
/*
 * Backwards compatibility.
 */
39
#define NS_LOGCATEGORY_GENERAL		ISC_LOGCATEGORY_GENERAL
Bob Halley's avatar
add  
Bob Halley committed
40 41 42 43 44 45

#define NS_LOGMODULE_MAIN		(&ns_g_modules[0])
#define NS_LOGMODULE_CLIENT		(&ns_g_modules[1])
#define NS_LOGMODULE_SERVER		(&ns_g_modules[2])
#define NS_LOGMODULE_QUERY		(&ns_g_modules[3])
#define NS_LOGMODULE_INTERFACEMGR	(&ns_g_modules[4])
46 47 48
#define NS_LOGMODULE_UPDATE		(&ns_g_modules[5])
#define NS_LOGMODULE_XFER_IN		(&ns_g_modules[6])
#define NS_LOGMODULE_XFER_OUT		(&ns_g_modules[7])
Mark Andrews's avatar
Mark Andrews committed
49
#define NS_LOGMODULE_NOTIFY		(&ns_g_modules[8])
50
#define NS_LOGMODULE_CONTROL		(&ns_g_modules[9])
51
#define NS_LOGMODULE_LWRESD		(&ns_g_modules[10])
Bob Halley's avatar
add  
Bob Halley committed
52 53

isc_result_t
54 55 56 57 58
ns_log_init(isc_boolean_t safe);
/*
 * Initialize the logging system and set up an initial default
 * logging default configuration that will be used until the
 * config file has been read.
59
 *
60 61 62 63
 * If 'safe' is true, use a default configuration that refrains
 * from opening files.  This is to avoid creating log files
 * as root.
 */
Bob Halley's avatar
add  
Bob Halley committed
64

65
isc_result_t
66 67 68 69 70 71 72
ns_log_setdefaultchannels(isc_logconfig_t *lcfg);
/*
 * Set up logging channels according to the named defaults, which
 * may differ from the logging library defaults.  Currently,
 * this just means setting up default_debug.
 */

73 74 75
isc_result_t
ns_log_setsafechannels(isc_logconfig_t *lcfg);
/*
76
 * Like ns_log_setdefaultchannels(), but omits any logging to files.
77 78
 */

79 80 81 82 83
isc_result_t
ns_log_setdefaultcategory(isc_logconfig_t *lcfg);
/*
 * Set up "category default" to go to the right places.
 */
84

Bob Halley's avatar
add  
Bob Halley committed
85 86 87
void
ns_log_shutdown(void);

88
#endif /* NAMED_LOG_H */