diff --git a/softoff/softoff.cpp b/softoff/softoff.cpp
index df5807e..c522635 100644
--- a/softoff/softoff.cpp
+++ b/softoff/softoff.cpp
@@ -46,7 +46,7 @@
 
     if (jsonData.is_discarded())
     {
-        error("Parsing softoff config JSON file failed");
+        error("Failed to parse softoff config JSON file");
         return;
     }
 
@@ -69,8 +69,8 @@
             auto rc = getSensorInfo(entityType, stateSetId);
             if (rc != PLDM_SUCCESS)
             {
-                error("Message get Sensor PDRs error. PLDM error code = {RC}",
-                      "RC", lg2::hex, static_cast<int>(rc));
+                error("Failed to get Sensor PDRs, response code '{RC}'", "RC",
+                      lg2::hex, static_cast<int>(rc));
                 hasError = true;
                 return;
             }
@@ -113,8 +113,9 @@
     }
     catch (const std::exception& e)
     {
-        error("PLDM host soft off: Can't get current host state: {ERROR}",
-              "ERROR", e);
+        error(
+            "PLDM remote terminus soft off. Can't get current remote terminus state, error - {ERROR}",
+            "ERROR", e);
         hasError = true;
         return PLDM_ERROR;
     }
@@ -141,8 +142,9 @@
         auto rc = timer.stop();
         if (rc < 0)
         {
-            error("PLDM soft off: Failure to STOP the timer. ERRNO={RC}", "RC",
-                  rc);
+            error(
+                "Failure to STOP the timer of PLDM soft off, response code '{RC}'",
+                "RC", rc);
         }
 
         // This marks the completion of pldm soft power off.
@@ -157,7 +159,9 @@
 
     if (!fs::exists(softoffConfigJson) || fs::is_empty(softoffConfigJson))
     {
-        error("Parsing softoff config JSON file failed, File does not exist");
+        error(
+            "Failed to parse softoff config JSON file '{PATH}', file does not exist",
+            "PATH", softoffConfigJson);
         return PLDM_ERROR;
     }
 
@@ -195,8 +199,7 @@
     }
     catch (const sdbusplus::exception_t& e)
     {
-        error("PLDM soft off: Error get softPowerOff PDR,ERROR={ERR_EXCEP}",
-              "ERR_EXCEP", e.what());
+        error("Failed to get softPowerOff PDR, error - {ERROR}", "ERROR", e);
         return false;
     }
     return true;
@@ -259,8 +262,8 @@
     }
     catch (const sdbusplus::exception_t& e)
     {
-        error("PLDM soft off: Error get State Sensor PDR,ERROR={ERR_EXCEP}",
-              "ERR_EXCEP", e.what());
+        error("Failed to get state sensor PDR during soft-off, error - {ERROR}",
+              "ERROR", e);
         return PLDM_ERROR;
     }
 
@@ -291,8 +294,9 @@
     if (rc != PLDM_SUCCESS)
     {
         instanceIdDb.free(pldmTID, instanceID);
-        error("Message encode failure. PLDM error code = {RC}", "RC", lg2::hex,
-              static_cast<int>(rc));
+        error(
+            "Failed to encode set state effecter states request message, response code '{RC}'",
+            "RC", lg2::hex, static_cast<int>(rc));
         return PLDM_ERROR;
     }
 
@@ -303,7 +307,7 @@
         {
             instanceIdDb.free(pldmTID, instanceID);
             error(
-                "PLDM soft off: ERROR! Can't get the response for the PLDM request msg. Time out! Exit the pldm-softpoweroff");
+                "PLDM soft off failed, can't get the response for the PLDM request msg. Time out! Exit the pldm-softpoweroff");
             exit(-1);
         }
         return;
@@ -331,8 +335,9 @@
         auto rc = pldmTransport.recvMsg(pldmTID, responseMsg, responseMsgSize);
         if (rc)
         {
-            error("Soft off: failed to recv pldm data. PLDM RC = {RC}", "RC",
-                  static_cast<int>(rc));
+            error(
+                "Failed to receive pldm data during soft-off, response code '{RC}'",
+                "RC", static_cast<int>(rc));
             return;
         }
 
@@ -357,7 +362,7 @@
 
         if (response->payload[0] != PLDM_SUCCESS)
         {
-            error("Getting the wrong response. PLDM RC = {RC}", "RC",
+            error("Getting the wrong response, response code '{RC}'", "RC",
                   (unsigned)response->payload[0]);
             exit(-1);
         }
@@ -373,14 +378,14 @@
         if (ret < 0)
         {
             error(
-                "Failure to start Host soft off wait timer, ERRNO = {RET}. Exit the pldm-softpoweroff",
-                "RET", ret);
+                "Failure to start remote terminus soft off wait timer, Exit the pldm-softpoweroff with response code:{NUM}",
+                "NUM", ret);
             exit(-1);
         }
         else
         {
             error(
-                "Timer started waiting for host soft off, TIMEOUT_IN_SEC = {TIMEOUT_SEC}",
+                "Timer started waiting for remote terminus soft off, timeout in sec '{TIMEOUT_SEC}'",
                 "TIMEOUT_SEC", SOFTOFF_TIMEOUT_SECONDS);
         }
         return;
@@ -393,8 +398,8 @@
     {
         instanceIdDb.free(pldmTID, instanceID);
         error(
-            "Failed to send message/receive response. RC = {RC}, errno = {ERR}",
-            "RC", static_cast<int>(rc), "ERR", errno);
+            "Failed to send message/receive response, response code '{RC}' and error - {ERROR}",
+            "RC", static_cast<int>(rc), "ERROR", errno);
         return PLDM_ERROR;
     }
 
@@ -409,8 +414,8 @@
         {
             instanceIdDb.free(pldmTID, instanceID);
             error(
-                "PLDM host soft off: Failure in processing request.ERROR= {ERR_EXCEP}",
-                "ERR_EXCEP", e.what());
+                "Failed to process request while remote terminus soft off, error - {ERROR}",
+                "ERROR", e);
             return PLDM_ERROR;
         }
     }
