log.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004, 2005, 2007, 2009  Internet Systems Consortium, Inc. ("ISC")
00003  * Copyright (C) 1999-2002  Internet Software Consortium.
00004  *
00005  * Permission to use, copy, modify, and/or distribute this software for any
00006  * purpose with or without fee is hereby granted, provided that the above
00007  * copyright notice and this permission notice appear in all copies.
00008  *
00009  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
00010  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00011  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
00012  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
00013  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00014  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00015  * PERFORMANCE OF THIS SOFTWARE.
00016  */
00017 
00018 /* $Id: log.h,v 1.27 2009/01/07 23:47:46 tbox Exp $ */
00019 
00020 #ifndef NAMED_LOG_H
00021 #define NAMED_LOG_H 1
00022 
00023 /*! \file */
00024 
00025 #include <isc/log.h>
00026 #include <isc/types.h>
00027 
00028 #include <dns/log.h>
00029 
00030 #include <named/globals.h>      /* Required for ns_g_(categories|modules). */
00031 
00032 /* Unused slot 0. */
00033 #define NS_LOGCATEGORY_CLIENT           (&ns_g_categories[1])
00034 #define NS_LOGCATEGORY_NETWORK          (&ns_g_categories[2])
00035 #define NS_LOGCATEGORY_UPDATE           (&ns_g_categories[3])
00036 #define NS_LOGCATEGORY_QUERIES          (&ns_g_categories[4])
00037 #define NS_LOGCATEGORY_UNMATCHED        (&ns_g_categories[5])
00038 #define NS_LOGCATEGORY_UPDATE_SECURITY  (&ns_g_categories[6])
00039 #define NS_LOGCATEGORY_QUERY_EERRORS    (&ns_g_categories[7])
00040 
00041 /*
00042  * Backwards compatibility.
00043  */
00044 #define NS_LOGCATEGORY_GENERAL          ISC_LOGCATEGORY_GENERAL
00045 
00046 #define NS_LOGMODULE_MAIN               (&ns_g_modules[0])
00047 #define NS_LOGMODULE_CLIENT             (&ns_g_modules[1])
00048 #define NS_LOGMODULE_SERVER             (&ns_g_modules[2])
00049 #define NS_LOGMODULE_QUERY              (&ns_g_modules[3])
00050 #define NS_LOGMODULE_INTERFACEMGR       (&ns_g_modules[4])
00051 #define NS_LOGMODULE_UPDATE             (&ns_g_modules[5])
00052 #define NS_LOGMODULE_XFER_IN            (&ns_g_modules[6])
00053 #define NS_LOGMODULE_XFER_OUT           (&ns_g_modules[7])
00054 #define NS_LOGMODULE_NOTIFY             (&ns_g_modules[8])
00055 #define NS_LOGMODULE_CONTROL            (&ns_g_modules[9])
00056 #define NS_LOGMODULE_LWRESD             (&ns_g_modules[10])
00057 
00058 isc_result_t
00059 ns_log_init(isc_boolean_t safe);
00060 /*%
00061  * Initialize the logging system and set up an initial default
00062  * logging default configuration that will be used until the
00063  * config file has been read.
00064  *
00065  * If 'safe' is true, use a default configuration that refrains
00066  * from opening files.  This is to avoid creating log files
00067  * as root.
00068  */
00069 
00070 isc_result_t
00071 ns_log_setdefaultchannels(isc_logconfig_t *lcfg);
00072 /*%
00073  * Set up logging channels according to the named defaults, which
00074  * may differ from the logging library defaults.  Currently,
00075  * this just means setting up default_debug.
00076  */
00077 
00078 isc_result_t
00079 ns_log_setsafechannels(isc_logconfig_t *lcfg);
00080 /*%
00081  * Like ns_log_setdefaultchannels(), but omits any logging to files.
00082  */
00083 
00084 isc_result_t
00085 ns_log_setdefaultcategory(isc_logconfig_t *lcfg);
00086 /*%
00087  * Set up "category default" to go to the right places.
00088  */
00089 
00090 isc_result_t
00091 ns_log_setunmatchedcategory(isc_logconfig_t *lcfg);
00092 /*%
00093  * Set up "category unmatched" to go to the right places.
00094  */
00095 
00096 void
00097 ns_log_shutdown(void);
00098 
00099 #endif /* NAMED_LOG_H */

Generated on Tue Apr 28 17:41:04 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha