dhcp4_log.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. // Copyright (C) 2012, 2014-2015 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this
  5. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
  6. /// @file dhcp4_log.h
  7. /// Contains declarations for loggers used by the DHCPv4 server component.
  8. #ifndef DHCP4_LOG_H
  9. #define DHCP4_LOG_H
  10. #include <log/logger_support.h>
  11. #include <log/macros.h>
  12. #include <dhcp4/dhcp4_messages.h>
  13. namespace isc {
  14. namespace dhcp {
  15. /// @name Constants defining debug levels for logging in DHCPv4 server.
  16. //@{
  17. /// @brief Debug level used to log information during server startup.
  18. const int DBG_DHCP4_START = DBGLVL_START_SHUT;
  19. /// @brief Debug level used to log information during server shutdown.
  20. const int DBG_DHCP4_SHUT = DBGLVL_START_SHUT;
  21. /// @brief Debug level used to log receiving commands.
  22. const int DBG_DHCP4_COMMAND = DBGLVL_COMMAND;
  23. /// @brief Debug level used to trace basic operations within the code.
  24. const int DBG_DHCP4_BASIC = DBGLVL_TRACE_BASIC;
  25. /// @brief Debug level used to trace hook related operations
  26. const int DBG_DHCP4_HOOKS = DBGLVL_TRACE_BASIC;
  27. /// @brief Debug level used to log the traces with some basic data.
  28. ///
  29. /// The basic data includes summary information, e.g. summary of the
  30. /// information returned by a particular function. It may also include
  31. /// more detailed information in cases when it is warranted and the
  32. /// extraction of the data doesn't impact the server's performance
  33. /// significantly.
  34. const int DBG_DHCP4_BASIC_DATA = DBGLVL_TRACE_BASIC_DATA;
  35. /// @brief Debug level used to trace detailed errors.
  36. ///
  37. /// Trace detailed operations, including errors raised when processing invalid
  38. /// packets. (These are not logged at severities of WARN or higher for fear
  39. /// that a set of deliberately invalid packets set to the server could overwhelm
  40. /// the logging.)
  41. const int DBG_DHCP4_DETAIL = DBGLVL_TRACE_DETAIL;
  42. /// @brief This level is used to log the contents of packets received and sent.
  43. const int DBG_DHCP4_DETAIL_DATA = DBGLVL_TRACE_DETAIL_DATA;
  44. //@}
  45. /// @name Constants holding names of loggers for the DHCPv4 server.
  46. //@{
  47. /// @brief Defines the name of the root level (default) logger.
  48. extern const char* DHCP4_ROOT_LOGGER_NAME;
  49. /// @brief Name of the base logger for DHCPv4 server.
  50. extern const char* DHCP4_APP_LOGGER_NAME;
  51. /// @brief Name of the logger for rejected packets.
  52. extern const char* DHCP4_BAD_PACKET_LOGGER_NAME;
  53. /// @brief Name of the logger for processed packets.
  54. extern const char* DHCP4_PACKET_LOGGER_NAME;
  55. /// @brief Name of the logger for options parser.
  56. extern const char* DHCP4_OPTIONS_LOGGER_NAME;
  57. /// @brief Name of the logger for hostname or FQDN processing.
  58. extern const char* DHCP4_DDNS_LOGGER_NAME;
  59. /// @brief Name of the logger for lease allocation logic.
  60. extern const char* DHCP4_LEASE_LOGGER_NAME;
  61. //@}
  62. /// @name Loggers used by the DHCPv4 server
  63. //@{
  64. /// @brief Base logger for DHCPv4 server.
  65. extern isc::log::Logger dhcp4_logger;
  66. /// @brief Logger for rejected packets.
  67. ///
  68. /// Here "bad packets" are packets that are either dropped (i.e malformed,
  69. /// unsupported types) or packets that are rejected and NAKed for logical
  70. /// reasons.
  71. extern isc::log::Logger bad_packet4_logger;
  72. /// @brief Logger for processed packets.
  73. ///
  74. /// This logger is used to issue log messages related to the reception and
  75. /// sending DHCP packets.
  76. extern isc::log::Logger packet4_logger;
  77. /// @brief Logger for options parser.
  78. ///
  79. /// This logger is used to issue log messages related to processing of the
  80. /// DHCP options
  81. extern isc::log::Logger options4_logger;
  82. /// @brief Logger for Hostname or FQDN processing.
  83. ///
  84. /// This logger is used to issue log messages related to processing the
  85. /// hostnames, FQDNs and sending name change requests to D2.
  86. extern isc::log::Logger ddns4_logger;
  87. /// @brief Logger for lease allocation logic.
  88. ///
  89. /// This logger is used to issue log messages related to lease allocation.
  90. extern isc::log::Logger lease4_logger;
  91. //@}
  92. } // namespace dhcp4
  93. } // namespace isc
  94. #endif // DHCP4_LOG_H