dhcp4_log.h 4.1 KB
Newer Older
1
// Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC")
2
//
3 4 5
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6

7 8 9
/// @file dhcp4_log.h
/// Contains declarations for loggers used by the DHCPv4 server component.

10 11
#ifndef DHCP4_LOG_H
#define DHCP4_LOG_H
12 13

#include <log/logger_support.h>
14
#include <log/macros.h>
15 16 17 18 19
#include <dhcp4/dhcp4_messages.h>

namespace isc {
namespace dhcp {

20 21
/// @name Constants defining debug levels for logging in DHCPv4 server.
//@{
22

23
/// @brief Debug level used to log information during server startup.
Francis Dupont's avatar
Francis Dupont committed
24
const int DBG_DHCP4_START = isc::log::DBGLVL_START_SHUT;
25 26

/// @brief Debug level used to log information during server shutdown.
Francis Dupont's avatar
Francis Dupont committed
27
const int DBG_DHCP4_SHUT = isc::log::DBGLVL_START_SHUT;
28

29
/// @brief Debug level used to log receiving commands.
Francis Dupont's avatar
Francis Dupont committed
30
const int DBG_DHCP4_COMMAND = isc::log::DBGLVL_COMMAND;
31

32
/// @brief Debug level used to trace basic operations within the code.
Francis Dupont's avatar
Francis Dupont committed
33
const int DBG_DHCP4_BASIC = isc::log::DBGLVL_TRACE_BASIC;
34

35
/// @brief Debug level used to trace hook related operations
Francis Dupont's avatar
Francis Dupont committed
36
const int DBG_DHCP4_HOOKS = isc::log::DBGLVL_TRACE_BASIC;
37

38 39 40
/// @brief Debug level used to log the traces with some basic data.
///
/// The basic data includes summary information, e.g. summary of the
41
/// information returned by a particular function. It may also include
42 43 44
/// more detailed information in cases when it is warranted and the
/// extraction of the data doesn't impact the server's performance
/// significantly.
Francis Dupont's avatar
Francis Dupont committed
45
const int DBG_DHCP4_BASIC_DATA = isc::log::DBGLVL_TRACE_BASIC_DATA;
46

47 48 49 50 51 52
/// @brief Debug level used to trace detailed errors.
///
/// Trace detailed operations, including errors raised when processing invalid
/// packets.  (These are not logged at severities of WARN or higher for fear
/// that a set of deliberately invalid packets set to the server could overwhelm
/// the logging.)
Francis Dupont's avatar
Francis Dupont committed
53
const int DBG_DHCP4_DETAIL = isc::log::DBGLVL_TRACE_DETAIL;
54

55
/// @brief This level is used to log the contents of packets received and sent.
Francis Dupont's avatar
Francis Dupont committed
56
const int DBG_DHCP4_DETAIL_DATA = isc::log::DBGLVL_TRACE_DETAIL_DATA;
57

58 59 60 61 62 63 64 65 66
//@}

/// @name Constants holding names of loggers for the DHCPv4 server.
//@{

/// @brief Defines the name of the root level (default) logger.
extern const char* DHCP4_ROOT_LOGGER_NAME;

/// @brief Name of the base logger for DHCPv4 server.
67
extern const char* DHCP4_APP_LOGGER_NAME;
68

69
/// @brief Name of the logger for rejected packets.
70
extern const char* DHCP4_BAD_PACKET_LOGGER_NAME;
71 72 73 74 75 76 77 78

/// @brief Name of the logger for processed packets.
extern const char* DHCP4_PACKET_LOGGER_NAME;

/// @brief Name of the logger for options parser.
extern const char* DHCP4_OPTIONS_LOGGER_NAME;

/// @brief Name of the logger for hostname or FQDN processing.
79
extern const char* DHCP4_DDNS_LOGGER_NAME;
80 81 82 83 84 85 86 87 88 89 90 91 92 93

/// @brief Name of the logger for lease allocation logic.
extern const char* DHCP4_LEASE_LOGGER_NAME;

//@}

/// @name Loggers used by the DHCPv4 server
//@{

/// @brief Base logger for DHCPv4 server.
extern isc::log::Logger dhcp4_logger;

/// @brief Logger for rejected packets.
///
94
/// Here "bad packets" are packets that are either dropped (i.e malformed,
95 96
/// unsupported types) or packets that are rejected and NAKed for logical
/// reasons.
97
extern isc::log::Logger bad_packet4_logger;
98

99 100 101 102
/// @brief Logger for processed packets.
///
/// This logger is used to issue log messages related to the reception and
/// sending DHCP packets.
103
extern isc::log::Logger packet4_logger;
104 105 106 107

/// @brief Logger for options parser.
///
/// This logger is used to issue log messages related to processing of the
108
/// DHCP options
109
extern isc::log::Logger options4_logger;
110

111
/// @brief Logger for Hostname or FQDN processing.
112 113 114
///
/// This logger is used to issue log messages related to processing the
/// hostnames, FQDNs and sending name change requests to D2.
115
extern isc::log::Logger ddns4_logger;
116 117 118 119

/// @brief Logger for lease allocation logic.
///
/// This logger is used to issue log messages related to lease allocation.
120
extern isc::log::Logger lease4_logger;
121 122 123

//@}

124 125 126
} // namespace dhcp4
} // namespace isc

127
#endif // DHCP4_LOG_H