improved information content of logs: in LinkAnalyzer messages add cname chain
[pingcheck] / src / link / linkstatus.cpp
index defea52..51dcb1e 100644 (file)
@@ -23,6 +23,8 @@ on this file might be covered by the GNU General Public License.
 
 #include <logfunc.hpp>
 
+#include "dns/dnsmaster.h"
+
 #include "boost_assert_handler.h"
 
 using namespace std;
@@ -87,11 +89,11 @@ void LinkStatus::notify_host_up( const string &host_address )
     if (has_changed)
         GlobalLogger.notice() << "Status (" << HostsDownList.size()
             << "/" << HostsDownLimit << " down): now up again is "
-            << host_address << endl;
+            << DnsMaster::get_cname_chain_str(host_address) << endl;
     else   // less important so log only at info level
         GlobalLogger.info()  << "Status (" << HostsDownList.size()
             << "/" << HostsDownLimit << " down): still up is "
-            << host_address << endl;
+            << DnsMaster::get_cname_chain_str(host_address) << endl;
 
     if ( !exceeded_host_down_limit() )
     {
@@ -119,7 +121,7 @@ void LinkStatus::notify_host_down( const string &host_address )
     // report this always at notice level
     GlobalLogger.notice()  << "Status (" << HostsDownList.size()
         << "/" << HostsDownLimit << " down): down is "
-        << host_address << endl;
+        << DnsMaster::get_cname_chain_str(host_address) << endl;
 
     if ( exceeded_host_down_limit() )
     {