log.c revision 3fb1637c9265cc593973326ae193783413f68699
/*
* Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC 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.
*/
/* $Id: log.c,v 1.47 2009/01/05 23:20:21 jinmei Exp $ */
/*! \file */
#include <config.h>
#ifndef ISC_FACILITY
#define ISC_FACILITY LOG_DAEMON
#endif
/*%
* When adding a new category, be sure to add the appropriate
* bin/check/check-tool.c.
*/
static isc_logcategory_t categories[] = {
{ "", 0 },
{ "client", 0 },
{ "network", 0 },
{ "update", 0 },
{ "queries", 0 },
{ "unmatched", 0 },
{ "update-security", 0 },
{ NULL, 0 }
};
/*%
* When adding a new module, be sure to add the appropriate
*/
static isc_logmodule_t modules[] = {
{ "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 }
};
/*
* Setup a logging context.
*/
if (result != ISC_R_SUCCESS)
return (result);
/*
* named-checktool.c:setup_logging() needs to be kept in sync.
*/
if (safe)
else
if (result != ISC_R_SUCCESS)
goto cleanup;
if (result != ISC_R_SUCCESS)
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
}
/*
* By default, the logging library makes "default_debug" log to
* stderr. In BIND, we want to override this and log to named.run
* instead, unless the -g option was given.
*/
if (! ns_g_logstderr) {
if (result != ISC_R_SUCCESS)
goto cleanup;
}
#if ISC_FACILITY != LOG_DAEMON
&destination, 0);
if (result != ISC_R_SUCCESS)
goto cleanup;
#endif
/*
* Set the initial debug level.
*/
return (result);
}
#if ISC_FACILITY != LOG_DAEMON
#endif
if (! ns_g_logstderr) {
NULL, 0);
if (result != ISC_R_SUCCESS)
goto cleanup;
/*
* Setting the debug level to zero should get the output
* discarded a bit faster.
*/
} else {
}
#if ISC_FACILITY != LOG_DAEMON
&destination, 0);
if (result != ISC_R_SUCCESS)
goto cleanup;
#endif
return (result);
}
if (! ns_g_logstderr) {
if (result != ISC_R_SUCCESS)
goto cleanup;
}
if (result != ISC_R_SUCCESS)
goto cleanup;
return (result);
}
return (result);
}
void
ns_log_shutdown(void) {
}