diff --git a/main.cpp b/main.cpp
index 13da385..4e1dbe8 100644
--- a/main.cpp
+++ b/main.cpp
@@ -22,7 +22,7 @@
 
     if (rc < 0)
     {
-        std::cerr << "E> SLP Error in Read : " << std::hex << rc << "\n";
+        std::cerr << "SLP Error in Read : " << std::hex << rc << "\n";
         return rc;
     }
 
@@ -30,15 +30,6 @@
     {
         case slp::VERSION_2:
         {
-            std::cout << "SLP Request" << "\n";
-            //print the buffer
-            std::for_each(recvBuff.begin(), recvBuff.end(),
-                          [](uint8_t & ch)
-            {
-                std::cout << std::hex << std::setfill('0')
-                          << std::setw(2) << (int)ch << ' ' ;
-            });
-            std::cout << "\n";
             //Parse the buffer and construct the req object
             std::tie(rc, req) = slp::parser::parseBuffer(recvBuff);
             if (!rc)
@@ -49,6 +40,9 @@
             break;
         }
         default:
+            std::cout << "SLP Unsupported Request Version="
+                      << (int)recvBuff[0] <<"\n";
+
             rc = static_cast<uint8_t>(slp::Error::VER_NOT_SUPPORTED);
             break;
     }
@@ -57,19 +51,10 @@
     //or processing of request then handle the error.
     if (rc)
     {
-        std::cerr << "E> SLP Error rc=" << rc << "\n";
+        std::cerr << "SLP Error rc=" << rc << "\n";
         resp = slp::handler::processError(req, rc);
     }
 
-    //print and send the response
-    std::cout << "SLP Response" << "\n";
-    std::for_each(resp.begin(), resp.end(),
-                  [](uint8_t & ch)
-    {
-        std::cout << std::hex << std::setfill('0')
-                  << std::setw(2) << (int)ch << ' ' ;
-    });
-
     channel.write(resp);
     return slp::SUCCESS;
 }
diff --git a/slp_message_handler.cpp b/slp_message_handler.cpp
index 5fd3e38..14ed15f 100644
--- a/slp_message_handler.cpp
+++ b/slp_message_handler.cpp
@@ -90,6 +90,7 @@
     if (svcList.size() <= 0)
     {
         buff.resize(0);
+        std::cerr << "SLP unable to read the service info\n";
         return std::make_tuple((int)slp::Error::INTERNAL_ERROR, buff);
     }
 
@@ -181,6 +182,7 @@
     if (svcList.size() <= 0)
     {
         buff.resize(0);
+        std::cerr << "SLP unable to read the service info\n";
         return std::make_tuple((int)slp::Error::INTERNAL_ERROR, buff);
     }
 
@@ -190,6 +192,7 @@
     if (svcIt == svcList.end())
     {
         buff.resize(0);
+        std::cerr << "SLP unable to find the service=" << svcName << "\n";
         return std::make_tuple((int)slp::Error::INTERNAL_ERROR, buff);
     }
     //Get all the interface address
@@ -197,6 +200,7 @@
     if (ifaddrList.size() <= 0)
     {
         buff.resize(0);
+        std::cerr << "SLP unable to read the interface address\n";
         return std::make_tuple((int)slp::Error::INTERNAL_ERROR, buff);
     }
 
@@ -363,6 +367,9 @@
     buffer resp(0);
     switch (msg.header.functionID)
     {
+        std::cout << "SLP Processing Request="
+                  << msg.header.functionID <<"\n";
+
         case (uint8_t)slp::FunctionType::SRVTYPERQST:
             std::tie(rc, resp) = slp::handler::internal::processSrvTypeRequest(msg);
             break;
