diff --git a/fw-update/device_updater.cpp b/fw-update/device_updater.cpp
index 20bca0c..738b4af 100644
--- a/fw-update/device_updater.cpp
+++ b/fw-update/device_updater.cpp
@@ -48,10 +48,11 @@
         sizeof(struct pldm_request_update_req) + compImgSetVerStrInfo.length);
     if (rc)
     {
-        updateManager->instanceIdDb.free(eid, instanceId);
-        error("encode_request_update_req failed, EID = {EID}, RC = {RC}", "EID",
-              unsigned(eid), "RC", rc);
         // Handle error scenario
+        updateManager->instanceIdDb.free(eid, instanceId);
+        error(
+            "Failed to encode request update request for endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
     }
 
     rc = updateManager->handler.registerRequest(
@@ -59,9 +60,10 @@
         std::move(std::bind_front(&DeviceUpdater::requestUpdate, this)));
     if (rc)
     {
-        error("Failed to send RequestUpdate request, EID = {EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
         // Handle error scenario
+        error(
+            "Failed to send request update for endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
     }
 }
 
@@ -71,8 +73,8 @@
     if (response == nullptr || !respMsgLen)
     {
         // Handle error scenario
-        error("No response received for RequestUpdate, EID = {EID}", "EID",
-              unsigned(eid));
+        error("No response received for request update for endpoint ID '{EID}'",
+              "EID", unsigned(eid));
         return;
     }
 
@@ -84,14 +86,15 @@
                                          &fdMetaDataLen, &fdWillSendPkgData);
     if (rc)
     {
-        error("Decoding RequestUpdate response failed, EID = {EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
+        error(
+            "Failed to decode request update response for endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
         return;
     }
     if (completionCode)
     {
         error(
-            "RequestUpdate response failed with error completion code, EID = {EID}, CC = {CC}",
+            "Failure in request update response for endpoint ID '{EID}', completion code '{CC}'",
             "EID", unsigned(eid), "CC", unsigned(completionCode));
         return;
     }
@@ -147,6 +150,9 @@
     else
     {
         // Handle error scenario
+        error(
+            "Failed to find component classification '{CLASSIFICATION}' and identifier '{IDENTIFIER}'",
+            "CLASSIFICATION", compClassification, "IDENTIFIER", compIdentifier);
     }
     // ComponentComparisonStamp
     CompComparisonStamp compComparisonStamp = std::get<static_cast<size_t>(
@@ -170,10 +176,11 @@
         sizeof(pldm_pass_component_table_req) + compVerStrInfo.length);
     if (rc)
     {
-        updateManager->instanceIdDb.free(eid, instanceId);
-        error("encode_pass_component_table_req failed, EID = {EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
         // Handle error scenario
+        updateManager->instanceIdDb.free(eid, instanceId);
+        error(
+            "Failed to encode pass component table req for endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
     }
 
     rc = updateManager->handler.registerRequest(
@@ -182,10 +189,10 @@
         std::move(std::bind_front(&DeviceUpdater::passCompTable, this)));
     if (rc)
     {
-        error(
-            "Failed to send PassComponentTable request, EID = {EID}, RC = {RC}",
-            "EID", unsigned(eid), "RC", rc);
         // Handle error scenario
+        error(
+            "Failed to send pass component table request for endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
     }
 }
 
@@ -195,8 +202,9 @@
     if (response == nullptr || !respMsgLen)
     {
         // Handle error scenario
-        error("No response received for PassComponentTable, EID = {EID}", "EID",
-              unsigned(eid));
+        error(
+            "No response received for pass component table for endpoint ID '{EID}'",
+            "EID", unsigned(eid));
         return;
     }
 
@@ -211,7 +219,7 @@
     {
         // Handle error scenario
         error(
-            "Decoding PassComponentTable response failed, EID={EID}, RC = {RC}",
+            "Failed to decode pass component table response for endpoint ID '{EID}', response code '{RC}'",
             "EID", unsigned(eid), "RC", rc);
         return;
     }
@@ -219,7 +227,7 @@
     {
         // Handle error scenario
         error(
-            "PassComponentTable response failed with error completion code, EID = {EID}, CC = {CC}",
+            "Failed to pass component table response for endpoint ID '{EID}', completion code '{CC}'",
             "EID", unsigned(eid), "CC", unsigned(completionCode));
         return;
     }
@@ -271,6 +279,9 @@
     else
     {
         // Handle error scenario
+        error(
+            "Failed to find component classification '{CLASSIFICATION}' and identifier '{IDENTIFIER}'",
+            "CLASSIFICATION", compClassification, "IDENTIFIER", compIdentifier);
     }
 
     // UpdateOptionFlags
@@ -297,10 +308,11 @@
         sizeof(pldm_update_component_req) + compVerStrInfo.length);
     if (rc)
     {
-        updateManager->instanceIdDb.free(eid, instanceId);
-        error("encode_update_component_req failed, EID={EID}, RC = {RC}", "EID",
-              unsigned(eid), "RC", rc);
         // Handle error scenario
+        updateManager->instanceIdDb.free(eid, instanceId);
+        error(
+            "Failed to encode update component req for endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
     }
 
     rc = updateManager->handler.registerRequest(
@@ -308,9 +320,10 @@
         std::move(std::bind_front(&DeviceUpdater::updateComponent, this)));
     if (rc)
     {
-        error("Failed to send UpdateComponent request, EID={EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
         // Handle error scenario
+        error(
+            "Failed to send update request for endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
     }
 }
 
@@ -320,8 +333,9 @@
     if (response == nullptr || !respMsgLen)
     {
         // Handle error scenario
-        error("No response received for updateComponent, EID={EID}", "EID",
-              unsigned(eid));
+        error(
+            "No response received for update component with endpoint ID {EID}",
+            "EID", unsigned(eid));
         return;
     }
 
@@ -337,14 +351,15 @@
         &timeBeforeReqFWData);
     if (rc)
     {
-        error("Decoding UpdateComponent response failed, EID={EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
+        error(
+            "Failed to decode update request response for endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
         return;
     }
     if (completionCode)
     {
         error(
-            "UpdateComponent response failed with error completion code, EID = {EID}, CC = {CC}",
+            "Failed to update request response for endpoint ID '{EID}', completion code '{CC}'",
             "EID", unsigned(eid), "CC", unsigned(completionCode));
         return;
     }
@@ -363,7 +378,7 @@
     if (rc)
     {
         error(
-            "Decoding RequestFirmwareData request failed, EID={EID}, RC = {RC}",
+            "Failed to decode request firmware date request for endpoint ID '{EID}', response code '{RC}'",
             "EID", unsigned(eid), "RC", rc);
         rc = encode_request_firmware_data_resp(
             request->hdr.instance_id, PLDM_ERROR_INVALID_DATA, responseMsg,
@@ -371,7 +386,7 @@
         if (rc)
         {
             error(
-                "Encoding RequestFirmwareData response failed, EID = {EID}, RC = {RC}",
+                "Failed to encode request firmware date response for endpoint ID '{EID}', response code '{RC}'",
                 "EID", unsigned(eid), "RC", rc);
         }
         return response;
@@ -382,8 +397,8 @@
     const auto& comp = compImageInfos[applicableComponents[componentIndex]];
     auto compOffset = std::get<5>(comp);
     auto compSize = std::get<6>(comp);
-    error("offset = {OFFSET}, length = {LEN}", "OFFSET", unsigned(offset),
-          "LEN", unsigned(length));
+    info("Decoded fw request data at offset '{OFFSET}' and length '{LENGTH}' ",
+         "OFFSET", unsigned(offset), "LENGTH", unsigned(length));
     if (length < PLDM_FWUP_BASELINE_TRANSFER_SIZE || length > maxTransferSize)
     {
         rc = encode_request_firmware_data_resp(
@@ -392,7 +407,7 @@
         if (rc)
         {
             error(
-                "Encoding RequestFirmwareData response failed, EID={EID}, RC = {RC}",
+                "Failed to encode request firmware date response for endpoint ID '{EID}', response code '{RC}'",
                 "EID", unsigned(eid), "RC", rc);
         }
         return response;
@@ -406,7 +421,7 @@
         if (rc)
         {
             error(
-                "Encoding RequestFirmwareData response failed, EID={EID}, RC = {RC}",
+                "Failed to encode request firmware date response for endpoint ID '{EID}', response code '{RC}'",
                 "EID", unsigned(eid), "RC", rc);
         }
         return response;
@@ -431,7 +446,7 @@
     if (rc)
     {
         error(
-            "Encoding RequestFirmwareData response failed, EID={EID}, RC = {RC}",
+            "Failed to encode request firmware date response for endpoint ID '{EID}', response code '{RC}'",
             "EID", unsigned(eid), "RC", rc);
         return response;
     }
@@ -451,15 +466,16 @@
                                            &transferResult);
     if (rc)
     {
-        error("Decoding TransferComplete request failed, EID={EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
+        error(
+            "Failed to decode TransferComplete request for endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
         rc = encode_transfer_complete_resp(request->hdr.instance_id,
                                            PLDM_ERROR_INVALID_DATA, responseMsg,
                                            sizeof(completionCode));
         if (rc)
         {
             error(
-                "Encoding TransferComplete response failed, EID={EID}, RC = {RC}",
+                "Failed to encode TransferComplete response for endpoint ID '{EID}', response code '{RC}'",
                 "EID", unsigned(eid), "RC", rc);
         }
         return response;
@@ -473,14 +489,14 @@
     if (transferResult == PLDM_FWUP_TRANSFER_SUCCESS)
     {
         info(
-            "Component Transfer complete, EID = {EID}, COMPONENT_VERSION = {COMP_VERS}",
-            "EID", unsigned(eid), "COMP_VERS", compVersion);
+            "Component endpoint ID '{EID}' and version '{COMPONENT_VERSION}' transfer complete.",
+            "EID", unsigned(eid), "COMPONENT_VERSION", compVersion);
     }
     else
     {
         error(
-            "Transfer of the component failed, EID={EID}, COMPONENT_VERSION = {COMP_VERS}, TRANSFER_RESULT = {TRANS_RES}",
-            "EID", unsigned(eid), "COMP_VERS", compVersion, "TRANS_RES",
+            "Failure in transfer of the component endpoint ID '{EID}' and version '{COMPONENT_VERSION}' with transfer result - {RESULT}",
+            "EID", unsigned(eid), "COMPONENT_VERSION", compVersion, "RESULT",
             unsigned(transferResult));
     }
 
@@ -488,8 +504,9 @@
                                        responseMsg, sizeof(completionCode));
     if (rc)
     {
-        error("Encoding TransferComplete response failed, EID={EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
+        error(
+            "Failed to encode transfer complete response of endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
         return response;
     }
 
@@ -507,15 +524,16 @@
     auto rc = decode_verify_complete_req(request, payloadLength, &verifyResult);
     if (rc)
     {
-        error("Decoding VerifyComplete request failed, EID = {EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
+        error(
+            "Failed to decode verify complete request of endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
         rc = encode_verify_complete_resp(request->hdr.instance_id,
                                          PLDM_ERROR_INVALID_DATA, responseMsg,
                                          sizeof(completionCode));
         if (rc)
         {
             error(
-                "Encoding VerifyComplete response failed, EID={EID}, RC = {RC}",
+                "Failed to encode verify complete response of endpoint ID '{EID}', response code '{RC}'.",
                 "EID", unsigned(eid), "RC", rc);
         }
         return response;
@@ -529,14 +547,14 @@
     if (verifyResult == PLDM_FWUP_VERIFY_SUCCESS)
     {
         info(
-            "Component verification complete, EID={EID}, COMPONENT_VERSION={COMP_VERS}",
-            "EID", unsigned(eid), "COMP_VERS", compVersion);
+            "Component endpoint ID '{EID}' and version '{COMPONENT_VERSION}' verification complete.",
+            "EID", unsigned(eid), "COMPONENT_VERSION", compVersion);
     }
     else
     {
         error(
-            "Component verification failed, EID={EID}, COMPONENT_VERSION={COMP_VERS}, VERIFY_RESULT={VERIFY_RES}",
-            "EID", unsigned(eid), "COMP_VERS", compVersion, "VERIFY_RES",
+            "Failed to verify component endpoint ID '{EID}' and version '{COMPONENT_VERSION}' with transfer result - '{RESULT}'",
+            "EID", unsigned(eid), "COMPONENT_VERSION", compVersion, "RESULT",
             unsigned(verifyResult));
     }
 
@@ -544,8 +562,9 @@
                                      responseMsg, sizeof(completionCode));
     if (rc)
     {
-        error("Encoding VerifyComplete response failed, EID={EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
+        error(
+            "Failed to encode verify complete response for endpoint ID '{EID}', response code - {RC}",
+            "EID", unsigned(eid), "RC", rc);
         return response;
     }
 
@@ -565,15 +584,16 @@
                                         &compActivationModification);
     if (rc)
     {
-        error("Decoding ApplyComplete request failed, EID={EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
+        error(
+            "Failed to decode apply complete request for endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
         rc = encode_apply_complete_resp(request->hdr.instance_id,
                                         PLDM_ERROR_INVALID_DATA, responseMsg,
                                         sizeof(completionCode));
         if (rc)
         {
             error(
-                "Encoding ApplyComplete response failed, EID={EID}, RC = {RC}",
+                "Failed to encode apply complete response for endpoint ID '{EID}', response code '{RC}'",
                 "EID", unsigned(eid), "RC", rc);
         }
         return response;
@@ -588,15 +608,15 @@
         applyResult == PLDM_FWUP_APPLY_SUCCESS_WITH_ACTIVATION_METHOD)
     {
         info(
-            "Component apply complete, EID = {EID}, COMPONENT_VERSION = {COMP_VERS}",
-            "EID", unsigned(eid), "COMP_VERS", compVersion);
+            "Component endpoint ID '{EID}' with '{COMPONENT_VERSION}' apply complete.",
+            "EID", unsigned(eid), "COMPONENT_VERSION", compVersion);
         updateManager->updateActivationProgress();
     }
     else
     {
         error(
-            "Component apply failed, EID = {EID}, COMPONENT_VERSION = {COMP_VERS}, APPLY_RESULT = {APPLY_RES}",
-            "EID", unsigned(eid), "COMP_VERS", compVersion, "APPLY_RES",
+            "Failed to apply component endpoint ID '{EID}' and version '{COMPONENT_VERSION}', error - {ERROR}",
+            "EID", unsigned(eid), "COMPONENT_VERSION", compVersion, "ERROR",
             unsigned(applyResult));
     }
 
@@ -604,8 +624,9 @@
                                     responseMsg, sizeof(completionCode));
     if (rc)
     {
-        error("Encoding ApplyComplete response failed, EID={EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
+        error(
+            "Failed to encode apply complete response for endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
         return response;
     }
 
@@ -642,8 +663,9 @@
     if (rc)
     {
         updateManager->instanceIdDb.free(eid, instanceId);
-        error("encode_activate_firmware_req failed, EID={EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
+        error(
+            "Failed to encode activate firmware req for endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
     }
 
     rc = updateManager->handler.registerRequest(
@@ -651,8 +673,9 @@
         std::move(std::bind_front(&DeviceUpdater::activateFirmware, this)));
     if (rc)
     {
-        error("Failed to send ActivateFirmware request, EID={EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
+        error(
+            "Failed to send activate firmware request for endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
     }
 }
 
@@ -662,8 +685,9 @@
     if (response == nullptr || !respMsgLen)
     {
         // Handle error scenario
-        error("No response received for ActivateFirmware, EID={EID}", "EID",
-              unsigned(eid));
+        error(
+            "No response received for activate firmware for endpoint ID '{EID}'",
+            "EID", eid);
         return;
     }
 
@@ -675,16 +699,17 @@
     if (rc)
     {
         // Handle error scenario
-        error("Decoding ActivateFirmware response failed, EID={EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
+        error(
+            "Failed to decode activate firmware response for endpoint ID '{EID}', response code '{RC}'",
+            "EID", eid, "RC", rc);
         return;
     }
     if (completionCode)
     {
         // Handle error scenario
         error(
-            "ActivateFirmware response failed with error completion code, EID = {EID}, CC = {CC}",
-            "EID", unsigned(eid), "CC", unsigned(completionCode));
+            "Failed to activate firmware response for endpoint ID '{EID}', completion code '{CC}'",
+            "EID", eid, "CC", completionCode);
         return;
     }
 
diff --git a/fw-update/inventory_manager.cpp b/fw-update/inventory_manager.cpp
index f5a797b..b8f86ea 100644
--- a/fw-update/inventory_manager.cpp
+++ b/fw-update/inventory_manager.cpp
@@ -29,7 +29,7 @@
         {
             instanceIdDb.free(eid, instanceId);
             error(
-                "encode_query_device_identifiers_req failed, EID={EID}, RC = {RC}",
+                "Failed to encode query device identifiers req for endpoint ID '{EID}', response code '{RC}'",
                 "EID", unsigned(eid), "RC", rc);
             continue;
         }
@@ -42,7 +42,7 @@
         if (rc)
         {
             error(
-                "Failed to send QueryDeviceIdentifiers request, EID={EID}, RC = {RC}",
+                "Failed to send query device identifiers request for endpoint ID '{EID}', response code '{RC}'",
                 "EID", unsigned(eid), "RC", rc);
         }
     }
@@ -54,8 +54,9 @@
 {
     if (response == nullptr || !respMsgLen)
     {
-        error("No response received for QueryDeviceIdentifiers, EID={EID}",
-              "EID", unsigned(eid));
+        error(
+            "No response received for query device identifiers for endpoint ID '{EID}'",
+            "EID", unsigned(eid));
         return;
     }
 
@@ -70,15 +71,16 @@
     if (rc)
     {
         error(
-            "Decoding QueryDeviceIdentifiers response failed, EID={EID}, RC = {RC}",
-            "EID", unsigned(eid), "RC", rc);
+            "Failed to decode query device identifiers response for endpoint ID '{EID}' and descriptor count '{DESCRIPTOR_COUNT}', response code '{RC}'",
+            "EID", unsigned(eid), "DESCRIPTOR_COUNT", descriptorCount, "RC",
+            rc);
         return;
     }
 
     if (completionCode)
     {
         error(
-            "QueryDeviceIdentifiers response failed with error completion code, EID={EID}, CC = {CC}",
+            "Failed to query device identifiers response for endpoint ID '{EID}', completion code '{CC}'",
             "EID", unsigned(eid), "CC", unsigned(completionCode));
         return;
     }
@@ -95,8 +97,9 @@
         if (rc)
         {
             error(
-                "Decoding descriptor type, length and value failed, EID={EID}, RC = {RC}",
-                "EID", unsigned(eid), "RC", rc);
+                "Failed to decode descriptor type {TYPE}, length {LENGTH} and value for endpoint ID '{EID}', response code '{RC}'",
+                "TYPE", descriptorType, "LENGTH", deviceIdentifiersLen, "EID",
+                unsigned(eid), "RC", rc);
             return;
         }
 
@@ -119,7 +122,7 @@
             if (rc)
             {
                 error(
-                    "Decoding Vendor-defined descriptor value failed, EID={EID}, RC = {RC}",
+                    "Failed to decode vendor-defined descriptor value for endpoint ID '{EID}', response code '{RC}'",
                     "EID", unsigned(eid), "RC", rc);
                 return;
             }
@@ -159,8 +162,9 @@
     if (rc)
     {
         instanceIdDb.free(eid, instanceId);
-        error("encode_get_firmware_parameters_req failed, EID={EID}, RC = {RC}",
-              "EID", unsigned(eid), "RC", rc);
+        error(
+            "Failed to encode get firmware parameters req for endpoint ID '{EID}', response code '{RC}'",
+            "EID", unsigned(eid), "RC", rc);
         return;
     }
 
@@ -172,7 +176,7 @@
     if (rc)
     {
         error(
-            "Failed to send GetFirmwareParameters request, EID={EID}, RC = {RC}",
+            "Failed to send get firmware parameters request for endpoint ID '{EID}', response code '{RC}'",
             "EID", unsigned(eid), "RC", rc);
     }
 }
@@ -183,8 +187,9 @@
 {
     if (response == nullptr || !respMsgLen)
     {
-        error("No response received for GetFirmwareParameters, EID={EID}",
-              "EID", unsigned(eid));
+        error(
+            "No response received for get firmware parameters for endpoint ID '{EID}'",
+            "EID", unsigned(eid));
         descriptorMap.erase(eid);
         return;
     }
@@ -200,7 +205,7 @@
     if (rc)
     {
         error(
-            "Decoding GetFirmwareParameters response failed, EID={EID}, RC = {RC}",
+            "Failed to decode get firmware parameters response for endpoint ID '{EID}', response code '{RC}'",
             "EID", unsigned(eid), "RC", rc);
         return;
     }
@@ -208,7 +213,7 @@
     if (fwParams.completion_code)
     {
         error(
-            "GetFirmwareParameters response failed with error completion code, EID={EID}, CC = {CC}",
+            "Failed to get firmware parameters response for endpoint ID '{EID}', completion code '{CC}'",
             "EID", unsigned(eid), "CC", unsigned(fwParams.completion_code));
         return;
     }
@@ -228,7 +233,7 @@
         if (rc)
         {
             error(
-                "Decoding component parameter table entry failed, EID={EID}, RC = {RC}",
+                "Failed to decode component parameter table entry for endpoint ID '{EID}', response code '{RC}'",
                 "EID", unsigned(eid), "RC", rc);
             return;
         }
diff --git a/fw-update/package_parser.cpp b/fw-update/package_parser.cpp
index 8454770..e13a8d5 100644
--- a/fw-update/package_parser.cpp
+++ b/fw-update/package_parser.cpp
@@ -41,8 +41,9 @@
             &compImageSetVersionStr, &recordDescriptors, &fwDevicePkgData);
         if (rc)
         {
-            error("Decoding firmware device ID record failed, RC={RC}", "RC",
-                  rc);
+            error(
+                "Failed to decode firmware device ID record, response code '{RC}'",
+                "RC", rc);
             throw InternalFailure();
         }
 
@@ -59,7 +60,8 @@
             if (rc)
             {
                 error(
-                    "Decoding descriptor type, length and value failed, RC={RC}",
+                    "Failed to decode descriptor type value of type '{TYPE}' and  length '{LENGTH}', response code '{RC}'",
+                    "TYPE", descriptorType, "LENGTH", recordDescriptors.length,
                     "RC", rc);
                 throw InternalFailure();
             }
@@ -83,8 +85,9 @@
                 if (rc)
                 {
                     error(
-                        "Decoding Vendor-defined descriptor value failed, RC={RC}",
-                        "RC", rc);
+                        "Failed to decode vendor-defined descriptor value of type '{TYPE}' and  length '{LENGTH}', response code '{RC}'",
+                        "TYPE", descriptorType, "LENGTH",
+                        recordDescriptors.length, "RC", rc);
                     throw InternalFailure();
                 }
 
@@ -153,8 +156,9 @@
                                               &compImageInfo, &compVersion);
         if (rc)
         {
-            error("Decoding component image information failed, RC={RC}", "RC",
-                  rc);
+            error(
+                "Failed to decode component image information, response code '{RC}'",
+                "RC", rc);
             throw InternalFailure();
         }
 
@@ -199,8 +203,9 @@
             auto cmpVersion = std::get<static_cast<size_t>(
                 ComponentImageInfoPos::CompVersionPos)>(componentImageInfo);
             error(
-                "Validating the component location offset failed, COMP_VERSION={COMP_VERS}",
-                "COMP_VERS", cmpVersion);
+                "Failed to validate the component location offset '{OFFSET}' for version '{COMPONENT_VERSION}' and package size '{SIZE}'",
+                "OFFSET", compLocOffset, "COMPONENT_VERSION", cmpVersion,
+                "SIZE", calcPkgSize);
             throw InternalFailure();
         }
 
@@ -210,8 +215,8 @@
     if (calcPkgSize != pkgSize)
     {
         error(
-            "Package size does not match calculated package size, PKG_SIZE={PKG_SIZE}, CALC_PKG_SIZE={CAL_PKG_SIZE}",
-            "PKG_SIZE", pkgSize, "CAL_PKG_SIZE", calcPkgSize);
+            "Failed to match package size '{PKG_SIZE}' to calculated package size '{CALCULATED_PACKAGE_SIZE}'.",
+            "PKG_SIZE", pkgSize, "CALCULATED_PACKAGE_SIZE", calcPkgSize);
         throw InternalFailure();
     }
 }
@@ -221,15 +226,15 @@
 {
     if (pkgHeaderSize != pkgHdr.size())
     {
-        error("Package header size is invalid, PKG_HDR_SIZE={PKG_HDR_SIZE}",
-              "PKG_HDR_SIZE", pkgHeaderSize);
+        error("Invalid package header size '{PKG_HDR_SIZE}' ", "PKG_HDR_SIZE",
+              pkgHeaderSize);
         throw InternalFailure();
     }
 
     size_t offset = sizeof(pldm_package_header_information) + pkgVersion.size();
     if (offset + sizeof(DeviceIDRecordCount) >= pkgHeaderSize)
     {
-        error("Parsing package header failed, PKG_HDR_SIZE={PKG_HDR_SIZE}",
+        error("Failed to parse package header of size '{PKG_HDR_SIZE}'",
               "PKG_HDR_SIZE", pkgHeaderSize);
         throw InternalFailure();
     }
@@ -240,14 +245,13 @@
     offset = parseFDIdentificationArea(deviceIdRecCount, pkgHdr, offset);
     if (deviceIdRecCount != fwDeviceIDRecords.size())
     {
-        error(
-            "DeviceIDRecordCount entries not found, DEVICE_ID_REC_COUNT={DREC_CNT}",
-            "DREC_CNT", deviceIdRecCount);
+        error("Failed to find DeviceIDRecordCount {DREC_CNT} entries",
+              "DREC_CNT", deviceIdRecCount);
         throw InternalFailure();
     }
     if (offset + sizeof(ComponentImageCount) >= pkgHeaderSize)
     {
-        error("Parsing package header failed, PKG_HDR_SIZE={PKG_HDR_SIZE}",
+        error("Failed to parsing package header of size '{PKG_HDR_SIZE}'",
               "PKG_HDR_SIZE", pkgHeaderSize);
         throw InternalFailure();
     }
@@ -259,15 +263,14 @@
     offset = parseCompImageInfoArea(compImageCount, pkgHdr, offset);
     if (compImageCount != componentImageInfos.size())
     {
-        error(
-            "ComponentImageCount entries not found, COMP_IMAGE_COUNT={COMP_IMG_CNT}",
-            "COMP_IMG_CNT", compImageCount);
+        error("Failed to find ComponentImageCount '{COMP_IMG_CNT}' entries",
+              "COMP_IMG_CNT", compImageCount);
         throw InternalFailure();
     }
 
     if (offset + sizeof(PackageHeaderChecksum) != pkgHeaderSize)
     {
-        error("Parsing package header failed, PKG_HDR_SIZE={PKG_HDR_SIZE}",
+        error("Failed to parse package header of size '{PKG_HDR_SIZE}'",
               "PKG_HDR_SIZE", pkgHeaderSize);
         throw InternalFailure();
     }
@@ -279,8 +282,9 @@
     if (calcChecksum != checksum)
     {
         error(
-            "Parsing package header failed, CALC_CHECKSUM={CHK_SUM}, PKG_HDR_CHECKSUM={PKG_HDR_CHK_SUM}",
-            "CHK_SUM", calcChecksum, "PKG_HDR_CHK_SUM", checksum);
+            "Failed to parse package header for calculated checksum '{CALCULATED_CHECKSUM}' and header checksum '{PACKAGE_HEADER_CHECKSUM}'",
+            "CALCULATED_CHECKSUM", calcChecksum, "PACKAGE_HEADER_CHECKSUM",
+            checksum);
         throw InternalFailure();
     }
 
@@ -300,8 +304,9 @@
                                               &pkgHeader, &pkgVersion);
     if (rc)
     {
-        error("Decoding PLDM package header information failed, RC={RC}", "RC",
-              rc);
+        error(
+            "Failed to decode PLDM package header information, response code '{RC}'",
+            "RC", rc);
         return nullptr;
     }
 
diff --git a/fw-update/update_manager.cpp b/fw-update/update_manager.cpp
index 0e3128e..428613b 100644
--- a/fw-update/update_manager.cpp
+++ b/fw-update/update_manager.cpp
@@ -40,8 +40,8 @@
             software::Activation::Activations::Activating)
         {
             error(
-                "Activation of PLDM FW update package already in progress, PACKAGE_VERSION={PKG_VERS}",
-                "PKG_VERS", parser->pkgVersion);
+                "Activation of PLDM fw update package for version '{VERSION}' already in progress.",
+                "VERSION", parser->pkgVersion);
             std::filesystem::remove(packageFilePath);
             return -1;
         }
@@ -56,8 +56,8 @@
     if (!package.good())
     {
         error(
-            "Opening the PLDM FW update package failed, ERR={ERR}, PACKAGEFILE={PKG_FILE}",
-            "ERR", unsigned(errno), "PKG_FILE", packageFilePath.c_str());
+            "Failed to open the PLDM fw update package file '{FILE}', error - {ERROR}.",
+            "ERROR", unsigned(errno), "FILE", packageFilePath.c_str());
         package.close();
         std::filesystem::remove(packageFilePath);
         return -1;
@@ -67,8 +67,9 @@
     if (packageSize < sizeof(pldm_package_header_information))
     {
         error(
-            "PLDM FW update package length less than the length of the package header information, PACKAGESIZE={PKG_SIZE}",
-            "PKG_SIZE", packageSize);
+            "PLDM fw update package length {SIZE} less than the length of the package header information '{PACKAGE_HEADER_INFO_SIZE}'.",
+            "SIZE", packageSize, "PACKAGE_HEADER_INFO_SIZE",
+            sizeof(pldm_package_header_information));
         package.close();
         std::filesystem::remove(packageFilePath);
         return -1;
@@ -113,7 +114,7 @@
     }
     catch (const std::exception& e)
     {
-        error("Invalid PLDM package header: {ERROR}", "ERROR", e);
+        error("Invalid PLDM package header, error - {ERROR}", "ERROR", e);
         activation = std::make_unique<Activation>(
             pldm::utils::DBusHandler::getBus(), objPath,
             software::Activation::Activations::Invalid, this);
@@ -207,7 +208,7 @@
         auto dur =
             std::chrono::duration<double, std::milli>(endTime - startTime)
                 .count();
-        error("Firmware update time: {DURATION}ms", "DURATION", dur);
+        info("Firmware update time: {DURATION}ms", "DURATION", dur);
         activation->activation(software::Activation::Activations::Active);
     }
     return;
