Added updated IP into update successful log message.
authorBjoern Sikora <bjoern.sikora@intra2net.com>
Thu, 16 Oct 2014 11:08:44 +0000 (13:08 +0200)
committerBjoern Sikora <bjoern.sikora@intra2net.com>
Thu, 16 Oct 2014 11:08:44 +0000 (13:08 +0200)
src/logger.cpp
src/logger.hpp
src/service.cpp

index 19ef01b..7e3beb8 100644 (file)
@@ -992,13 +992,13 @@ void Logger::print_error_hostname_to_ip(const string& errMsg, const string& host
  * The update of the given service was successful.
  * @param service The service.
  */
-void Logger::print_update_service_successful(const string& service) const
+void Logger::print_update_service_successful(const string& service, const std::string& ip_addr) const
 {
     int level = 0;
     if ( level <= Loglevel )
     {
         ostringstream msg;
-        msg << "Updated service successful: " << service << endl;
+        msg << "Updated service successful: " << service << " to IP: " << ip_addr << endl;
         log_notice(msg.str());
     }
 }
index 7202410..cc3c1f0 100644 (file)
@@ -166,7 +166,7 @@ public:
 
     void print_error_hostname_to_ip(const std::string& errMsg, const std::string& hostname) const;
 
-    void print_update_service_successful(const std::string& service) const;
+    void print_update_service_successful(const std::string& service, const std::string& ip_addr) const;
 
     void print_webcheck_no_ip();
 
index 45d833e..de500c2 100644 (file)
@@ -307,7 +307,7 @@ void Service::update(const string& ip, const time_t current_time, bool changed_t
             // if update was successful, we need to set the Lastupdated and ActualIP base member.
             set_last_update(current_time,ip);
             ActualIP = ip;
-            Log->print_update_service_successful(service_name);
+            Log->print_update_service_successful(service_name,ip);
 
             ErrorCount = 0;
             ErrorServiceBlockedUntil = 0;