Browse Source

[1062] log database name in other log messages too

Jelte Jansen 13 years ago
parent
commit
959dc16381

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

@@ -275,18 +275,23 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
 
 
     if (!result_rrset) {
     if (!result_rrset) {
         if (records_found) {
         if (records_found) {
-            logger.debug(DBG_TRACE_DETAILED, DATASRC_DATABASE_FOUND_NXRRSET)
-                        .arg(name).arg(getClass()).arg(type);
+            logger.debug(DBG_TRACE_DETAILED,
+                         DATASRC_DATABASE_FOUND_NXRRSET)
+                        .arg(database_->getDBName()).arg(name)
+                        .arg(getClass()).arg(type);
             result_status = NXRRSET;
             result_status = NXRRSET;
         } else {
         } else {
-            logger.debug(DBG_TRACE_DETAILED, DATASRC_DATABASE_FOUND_NXDOMAIN)
-                        .arg(name).arg(getClass()).arg(type);
+            logger.debug(DBG_TRACE_DETAILED,
+                         DATASRC_DATABASE_FOUND_NXDOMAIN)
+                        .arg(database_->getDBName()).arg(name)
+                        .arg(getClass()).arg(type);
             result_status = NXDOMAIN;
             result_status = NXDOMAIN;
         }
         }
     } else {
     } else {
         sig_store.appendSignatures(result_rrset);
         sig_store.appendSignatures(result_rrset);
         logger.debug(DBG_TRACE_DETAILED,
         logger.debug(DBG_TRACE_DETAILED,
-                    DATASRC_DATABASE_FOUND_RRSET).arg(*result_rrset);
+                     DATASRC_DATABASE_FOUND_RRSET)
+                    .arg(database_->getDBName()).arg(*result_rrset);
     }
     }
     return (FindResult(result_status, result_rrset));
     return (FindResult(result_status, result_rrset));
 }
 }

+ 3 - 3
src/lib/datasrc/datasrc_messages.mes

@@ -90,15 +90,15 @@ 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
 The current search is aborted. Specific information about the exception is
 printed in this error message.
 printed in this error message.
 
 
-% DATASRC_DATABASE_FOUND_NXDOMAIN search in database resulted in NXDOMAIN for %1/%2/%3
+% 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
 The data returned by the database backend did not contain any data for the given
 domain name, class and type.
 domain name, class and type.
 
 
-% DATASRC_DATABASE_FOUND_NXRRSET search in database resulted in NXRRSET for %1/%2/%3
+% DATASRC_DATABASE_FOUND_NXRRSET search in datasource %1 resulted in NXRRSET for %2/%3/%4
 The data returned by the database backend contained data for the given domain
 The data returned by the database backend contained data for the given domain
 name and class, but not for the given type.
 name and class, but not for the given type.
 
 
-% DATASRC_DATABASE_FOUND_RRSET search in database resulted in RRset %1
+% DATASRC_DATABASE_FOUND_RRSET search in datasource %1 resulted in RRset %2
 The data returned by the database backend contained data for the given domain
 The data returned by the database backend contained data for the given domain
 name, and it either matches the type or has a relevant type. The RRset that is
 name, and it either matches the type or has a relevant type. The RRset that is
 returned is printed.
 returned is printed.

+ 1 - 1
src/lib/datasrc/tests/database_unittest.cc

@@ -332,7 +332,7 @@ checkRRset(isc::dns::ConstRRsetPtr rrset,
            const isc::dns::RRClass& rrclass,
            const isc::dns::RRClass& rrclass,
            const isc::dns::RRType& rrtype,
            const isc::dns::RRType& rrtype,
            const isc::dns::RRTTL& rrttl,
            const isc::dns::RRTTL& rrttl,
-           const std::vector<std::string> rdatas) {
+           const std::vector<std::string>& rdatas) {
     isc::dns::RRsetPtr expected_rrset(
     isc::dns::RRsetPtr expected_rrset(
         new isc::dns::RRset(name, rrclass, rrtype, rrttl));
         new isc::dns::RRset(name, rrclass, rrtype, rrttl));
     for (unsigned int i = 0; i < rdatas.size(); ++i) {
     for (unsigned int i = 0; i < rdatas.size(); ++i) {