Browse Source

[1063] Little bit of logging

Michal 'vorner' Vaner 13 years ago
parent
commit
4cbf309be8
2 changed files with 24 additions and 0 deletions
  1. 10 0
      src/lib/datasrc/database.cc
  2. 14 0
      src/lib/datasrc/datasrc_messages.mes

+ 10 - 0
src/lib/datasrc/database.cc

@@ -314,8 +314,14 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
                 // (it can be only NS or DNAME here)
                 result_rrset = found.second;
                 if (result_rrset->getType() == isc::dns::RRType::NS()) {
+                    LOG_DEBUG(logger, DBG_TRACE_DETAILED,
+                              DATASRC_DATABASE_FOUND_DELEGATION).
+                        arg(superdomain);
                     result_status = DELEGATION;
                 } else {
+                    LOG_DEBUG(logger, DBG_TRACE_DETAILED,
+                              DATASRC_DATABASE_FOUND_DNAME).
+                        arg(superdomain);
                     result_status = DNAME;
                 }
                 // Don't search more
@@ -331,7 +337,11 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
             records_found = found.first;
             result_rrset = found.second;
             if (result_rrset && name != origin &&
+
                 result_rrset->getType() == isc::dns::RRType::NS()) {
+                LOG_DEBUG(logger, DBG_TRACE_DETAILED,
+                          DATASRC_DATABASE_FOUND_DELEGATION_EXACT).
+                    arg(name);
                 result_status = DELEGATION;
             } else if (result_rrset && type != isc::dns::RRType::CNAME() &&
                        result_rrset->getType() == isc::dns::RRType::CNAME()) {

+ 14 - 0
src/lib/datasrc/datasrc_messages.mes

@@ -90,6 +90,20 @@ most likely points to a logic error in the code, and can be considered a bug.
 The current search is aborted. Specific information about the exception is
 printed in this error message.
 
+% DATASRC_DATABASE_FOUND_DELEGATION Found delegation at %1
+When searching for a domain, the program met a delegation to a different zone
+at the given domain name. It will return that one instead.
+
+% DATASRC_DATABASE_FOUND_DELEGATION_EXACT Found delegation at %1 (exact match)
+The program found the domain requested, but it is a delegation point to a
+different zone, therefore it is not authoritative for this domain name.
+It will return the NS record instead.
+
+% DATASRC_DATABASE_FOUND_DNAME Found DNAME at %1
+When searching for a domain, the program met a DNAME redirection to a different
+place in the domain space at the given domain name. It will return that one
+instead.
+
 % DATASRC_DATABASE_FOUND_NXDOMAIN search in datasource %1 resulted in NXDOMAIN for %2/%3/%4
 The data returned by the database backend did not contain any data for the given
 domain name, class and type.