log.c File Reference

#include <config.h>
#include <isc/result.h>
#include <isccfg/log.h>
#include <named/log.h>

Go to the source code of this file.

Defines

#define ISC_FACILITY   LOG_DAEMON

Functions

isc_result_t ns_log_init (isc_boolean_t safe)
isc_result_t ns_log_setdefaultchannels (isc_logconfig_t *lcfg)
 Initialize the logging system and set up an initial default logging default configuration that will be used until the config file has been read.
isc_result_t ns_log_setsafechannels (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.
isc_result_t ns_log_setdefaultcategory (isc_logconfig_t *lcfg)
 Like ns_log_setdefaultchannels(), but omits any logging to files.
isc_result_t ns_log_setunmatchedcategory (isc_logconfig_t *lcfg)
 Set up "category default" to go to the right places.
void ns_log_shutdown (void)
 Set up "category unmatched" to go to the right places.

Variables

static isc_logcategory_t categories []
 When adding a new category, be sure to add the appropriate #define to <named/log.h> and to update the list in bin/check/check-tool.c.
static isc_logmodule_t modules []
 When adding a new module, be sure to add the appropriate #define to <dns/log.h>.


Detailed Description

Definition in file log.c.


Define Documentation

#define ISC_FACILITY   LOG_DAEMON

Definition at line 31 of file log.c.

Referenced by ns_log_setdefaultchannels(), ns_log_setsafechannels(), and setup_syslog().


Function Documentation

isc_result_t ns_log_init ( isc_boolean_t  safe  ) 

Definition at line 71 of file log.c.

References cfg_log_init(), cleanup(), dns_log_init(), dns_log_setcontext(), isc_log_create(), isc_log_destroy(), isc_log_registercategories(), isc_log_registermodules(), isc_log_setcontext(), ISC_R_SUCCESS, ns_log_setdefaultcategory(), ns_log_setdefaultchannels(), and ns_log_setsafechannels().

Referenced by setup().

isc_result_t ns_log_setdefaultchannels ( isc_logconfig_t lcfg  ) 

Initialize the logging system and set up an initial default logging default configuration that will be used until the config file has been read.

If 'safe' is true, use a default configuration that refrains from opening files. This is to avoid creating log files as root.

Definition at line 117 of file log.c.

References cleanup(), isc_logdestination::facility, isc_logdestination::file, ISC_FACILITY, isc_log_createchannel(), ISC_LOG_DEBUGONLY, ISC_LOG_DYNAMIC, ISC_LOG_INFO, ISC_LOG_PRINTCATEGORY, ISC_LOG_PRINTLEVEL, ISC_LOG_PRINTTIME, ISC_LOG_ROLLNEVER, isc_log_setdebuglevel(), ISC_LOG_TOFILE, ISC_LOG_TOSYSLOG, ISC_R_SUCCESS, isc_logfile::maximum_size, isc_logfile::name, isc_logfile::stream, and isc_logfile::versions.

Referenced by load_configuration(), ns_log_configure(), and ns_log_init().

isc_result_t ns_log_setsafechannels ( 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.

Definition at line 178 of file log.c.

References cleanup(), isc_logdestination::facility, isc_logdestination::file, ISC_FACILITY, isc_log_createchannel(), ISC_LOG_DYNAMIC, ISC_LOG_INFO, ISC_LOG_PRINTCATEGORY, ISC_LOG_PRINTLEVEL, ISC_LOG_PRINTTIME, ISC_LOG_ROLLNEVER, isc_log_setdebuglevel(), ISC_LOG_TOFILE, ISC_LOG_TONULL, ISC_LOG_TOSYSLOG, ISC_R_SUCCESS, isc_logfile::maximum_size, isc_logfile::name, isc_logfile::stream, and isc_logfile::versions.

Referenced by ns_log_init().

isc_result_t ns_log_setdefaultcategory ( isc_logconfig_t lcfg  ) 

Like ns_log_setdefaultchannels(), but omits any logging to files.

Definition at line 231 of file log.c.

References cleanup(), isc_log_usechannel(), ISC_LOGCATEGORY_DEFAULT, and ISC_R_SUCCESS.

Referenced by load_configuration(), ns_log_configure(), and ns_log_init().

isc_result_t ns_log_setunmatchedcategory ( isc_logconfig_t lcfg  ) 

Set up "category default" to go to the right places.

Definition at line 255 of file log.c.

References isc_log_usechannel(), and NS_LOGCATEGORY_UNMATCHED.

Referenced by load_configuration(), and ns_log_configure().

void ns_log_shutdown ( void   ) 

Set up "category unmatched" to go to the right places.

Definition at line 264 of file log.c.

References dns_log_setcontext(), isc_log_destroy(), and isc_log_setcontext().

Referenced by cleanup().


Variable Documentation

isc_logcategory_t categories[] [static]

Initial value:

 {
        { "",                           0 },
        { "client",                     0 },
        { "network",                    0 },
        { "update",                     0 },
        { "queries",                    0 },
        { "unmatched",                  0 },
        { "update-security",            0 },
        { "query-errors",               0 },
        { NULL,                         0 }
}
When adding a new category, be sure to add the appropriate #define to <named/log.h> and to update the list in bin/check/check-tool.c.

Definition at line 39 of file log.c.

isc_logmodule_t modules[] [static]

Initial value:

 {
        { "main",                       0 },
        { "client",                     0 },
        { "server",                     0 },
        { "query",                      0 },
        { "interfacemgr",               0 },
        { "update",                     0 },
        { "xfer-in",                    0 },
        { "xfer-out",                   0 },
        { "notify",                     0 },
        { "control",                    0 },
        { "lwresd",                     0 },
        { NULL,                         0 }
}
When adding a new module, be sure to add the appropriate #define to <dns/log.h>.

Definition at line 55 of file log.c.


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