diff --git a/libpldmresponder/bios.cpp b/libpldmresponder/bios.cpp
index 9aa44ea..39aad5b 100644
--- a/libpldmresponder/bios.cpp
+++ b/libpldmresponder/bios.cpp
@@ -346,7 +346,8 @@
         return ccOnlyResponse(request, rc);
     }
 
-    rc = biosConfig.setAttrValue(attributeField.ptr, attributeField.length);
+    rc = biosConfig.setAttrValue(attributeField.ptr, attributeField.length,
+                                 false);
 
     Response response(
         sizeof(pldm_msg_hdr) + PLDM_SET_BIOS_ATTR_CURR_VAL_RESP_BYTES, 0);
diff --git a/libpldmresponder/bios_config.cpp b/libpldmresponder/bios_config.cpp
index 704fa33..b9eeb79 100644
--- a/libpldmresponder/bios_config.cpp
+++ b/libpldmresponder/bios_config.cpp
@@ -26,7 +26,6 @@
 {
 namespace
 {
-
 using BIOSConfigManager =
     sdbusplus::xyz::openbmc_project::BIOSConfig::server::Manager;
 
@@ -137,8 +136,6 @@
 
     if ((tableType == PLDM_BIOS_ATTR_VAL_TABLE) && updateBaseBIOSTable)
     {
-        std::cout << "setBIOSTable:: updateBaseBIOSTableProperty() "
-                  << "\n";
         updateBaseBIOSTableProperty();
     }
 
@@ -625,6 +622,96 @@
     }
 }
 
+std::string BIOSConfig::decodeStringFromStringEntry(
+    const pldm_bios_string_table_entry* stringEntry)
+{
+    auto strLength =
+        pldm_bios_table_string_entry_decode_string_length(stringEntry);
+    std::vector<char> buffer(strLength + 1 /* sizeof '\0' */);
+    pldm_bios_table_string_entry_decode_string(stringEntry, buffer.data(),
+                                               buffer.size());
+    return std::string(buffer.data(), buffer.data() + strLength);
+}
+
+std::string
+    BIOSConfig::displayStringHandle(uint16_t handle, uint8_t index,
+                                    const std::optional<Table>& attrTable,
+                                    const std::optional<Table>& stringTable)
+{
+    auto attrEntry = pldm_bios_table_attr_find_by_handle(
+        attrTable->data(), attrTable->size(), handle);
+    auto pvNum = pldm_bios_table_attr_entry_enum_decode_pv_num(attrEntry);
+    std::vector<uint16_t> pvHandls(pvNum);
+    pldm_bios_table_attr_entry_enum_decode_pv_hdls(attrEntry, pvHandls.data(),
+                                                   pvHandls.size());
+
+    std::string displayString = std::to_string(pvHandls[index]);
+
+    auto stringEntry = pldm_bios_table_string_find_by_handle(
+        stringTable->data(), stringTable->size(), pvHandls[index]);
+
+    auto decodedStr = decodeStringFromStringEntry(stringEntry);
+
+    return decodedStr + "(" + displayString + ")";
+}
+
+void BIOSConfig::traceBIOSUpdate(
+    const pldm_bios_attr_val_table_entry* attrValueEntry,
+    const pldm_bios_attr_table_entry* attrEntry, bool isBMC)
+{
+    auto stringTable = getBIOSTable(PLDM_BIOS_STRING_TABLE);
+    auto attrTable = getBIOSTable(PLDM_BIOS_ATTR_TABLE);
+
+    auto [attrHandle, attrType] =
+        table::attribute_value::decodeHeader(attrValueEntry);
+
+    auto attrHeader = table::attribute::decodeHeader(attrEntry);
+    BIOSStringTable biosStringTable(*stringTable);
+    auto attrName = biosStringTable.findString(attrHeader.stringHandle);
+
+    switch (attrType)
+    {
+        case PLDM_BIOS_ENUMERATION:
+        case PLDM_BIOS_ENUMERATION_READ_ONLY:
+        {
+            auto count = pldm_bios_table_attr_value_entry_enum_decode_number(
+                attrValueEntry);
+            std::vector<uint8_t> handles(count);
+            pldm_bios_table_attr_value_entry_enum_decode_handles(
+                attrValueEntry, handles.data(), handles.size());
+
+            for (uint8_t handle : handles)
+            {
+                std::cout << "BIOS:" << attrName << ", updated to value: "
+                          << displayStringHandle(attrHandle, handle, attrTable,
+                                                 stringTable)
+                          << ", by BMC: " << std::boolalpha << isBMC << "\n";
+            }
+            break;
+        }
+        case PLDM_BIOS_INTEGER:
+        case PLDM_BIOS_INTEGER_READ_ONLY:
+        {
+            auto value =
+                table::attribute_value::decodeIntegerEntry(attrValueEntry);
+            std::cout << "BIOS:" << attrName << ", updated to value: " << value
+                      << ", by BMC:" << std::boolalpha << isBMC << std::endl;
+            break;
+        }
+        case PLDM_BIOS_STRING:
+        case PLDM_BIOS_STRING_READ_ONLY:
+        {
+            auto value =
+                table::attribute_value::decodeStringEntry(attrValueEntry);
+            std::cout << "BIOS:" << attrName << " updated to value: " << value
+                      << ", by BMC:" << std::boolalpha << isBMC << std::endl;
+            break;
+        }
+        default:
+            break;
+    };
+}
+
 int BIOSConfig::checkAttrValueToUpdate(
     const pldm_bios_attr_val_table_entry* attrValueEntry,
     const pldm_bios_attr_table_entry* attrEntry, Table&)
@@ -652,7 +739,6 @@
                           << std::endl;
                 return PLDM_ERROR_INVALID_DATA;
             }
-
             return PLDM_SUCCESS;
         }
         case PLDM_BIOS_INTEGER:
@@ -693,8 +779,8 @@
     };
 }
 
-int BIOSConfig::setAttrValue(const void* entry, size_t size, bool updateDBus,
-                             bool updateBaseBIOSTable)
+int BIOSConfig::setAttrValue(const void* entry, size_t size, bool isBMC,
+                             bool updateDBus, bool updateBaseBIOSTable)
 {
     auto attrValueTable = getBIOSTable(PLDM_BIOS_ATTR_VAL_TABLE);
     auto attrTable = getBIOSTable(PLDM_BIOS_ATTR_TABLE);
@@ -736,7 +822,6 @@
 
         BIOSStringTable biosStringTable(*stringTable);
         auto attrName = biosStringTable.findString(attrHeader.stringHandle);
-
         auto iter = std::find_if(
             biosAttributes.begin(), biosAttributes.end(),
             [&attrName](const auto& attr) { return attr->name == attrName; });
@@ -759,6 +844,8 @@
 
     setBIOSTable(PLDM_BIOS_ATTR_VAL_TABLE, *destTable, updateBaseBIOSTable);
 
+    traceBIOSUpdate(attrValueEntry, attrEntry, isBMC);
+
     return PLDM_SUCCESS;
 }
 
@@ -852,7 +939,7 @@
         storeTable(tableDir / attrValueTableFile, *destTable);
     }
 
-    rc = setAttrValue(newValue.data(), newValue.size(), false);
+    rc = setAttrValue(newValue.data(), newValue.size(), true, false);
     if (rc != PLDM_SUCCESS)
     {
         std::cerr << "could not setAttrValue on base bios table and dbus, rc = "
@@ -936,7 +1023,7 @@
 
         (*iter)->generateAttributeEntry(attributevalue, attrValueEntry);
 
-        setAttrValue(attrValueEntry.data(), attrValueEntry.size());
+        setAttrValue(attrValueEntry.data(), attrValueEntry.size(), true);
     }
 
     if (listOfHandles.size())
diff --git a/libpldmresponder/bios_config.hpp b/libpldmresponder/bios_config.hpp
index af214ab..867ff38 100644
--- a/libpldmresponder/bios_config.hpp
+++ b/libpldmresponder/bios_config.hpp
@@ -23,7 +23,6 @@
 {
 namespace bios
 {
-
 enum class BoundType
 {
     LowerBound,
@@ -84,14 +83,15 @@
     /** @brief Set attribute value on dbus and attribute value table
      *  @param[in] entry - attribute value entry
      *  @param[in] size - size of the attribute value entry
+     *  @param[in] isBMC - indicates if the attribute is set by BMC
      *  @param[in] updateDBus          - update Attr value D-Bus property
      *                                   if this is set to true
      *  @param[in] updateBaseBIOSTable - update BaseBIOSTable D-Bus property
      *                                   if this is set to true
      *  @return pldm_completion_codes
      */
-    int setAttrValue(const void* entry, size_t size, bool updateDBus = true,
-                     bool updateBaseBIOSTable = true);
+    int setAttrValue(const void* entry, size_t size, bool isBMC,
+                     bool updateDBus = true, bool updateBaseBIOSTable = true);
 
     /** @brief Remove the persistent tables */
     void removeTables();
@@ -244,6 +244,38 @@
      */
     std::optional<Table> loadTable(const fs::path& path);
 
+    /** @brief Method to decode the attribute name from the string handle
+     *
+     *  @param[in] stringEntry - string entry from string table
+     *  @return the decoded string
+     */
+    std::string decodeStringFromStringEntry(
+        const pldm_bios_string_table_entry* stringEntry);
+
+    /** @brief Method to print the string Handle by passing the attribute Handle
+     *         of the bios attribute that got updated
+     *
+     *  @param[in] handle - the Attribute handle of the bios attribute
+     *  @param[in] index - index to the possible value handles
+     *  @param[in] attrTable - the attribute table
+     *  @param[in] stringTable - the string table
+     *  @return string handle from the string table and decoded string to the
+     * name handle
+     */
+    std::string displayStringHandle(uint16_t handle, uint8_t index,
+                                    const std::optional<Table>& attrTable,
+                                    const std::optional<Table>& stringTable);
+
+    /** @brief Method to trace the bios attribute which got changed
+     *
+     *  @param[in] attrValueEntry - The attribute value entry to update
+     *  @param[in] attrEntry - The attribute table entry
+     *  @param[in] isBMC - indicates if the attribute is set by BMC
+     */
+    void traceBIOSUpdate(const pldm_bios_attr_val_table_entry* attrValueEntry,
+                         const pldm_bios_attr_table_entry* attrEntry,
+                         bool isBMC);
+
     /** @brief Check the attribute value to update
      *  @param[in] attrValueEntry - The attribute value entry to update
      *  @param[in] attrEntry - The attribute table entry
diff --git a/libpldmresponder/test/libpldmresponder_bios_config_test.cpp b/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
index da90689..4d4b843 100644
--- a/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
@@ -293,8 +293,8 @@
     PropertyValue value = std::string("abcd");
     EXPECT_CALL(dbusHandler, setDbusProperty(dbusMapping, value)).Times(1);
 
-    auto rc =
-        biosConfig.setAttrValue(attrValueEntry.data(), attrValueEntry.size());
+    auto rc = biosConfig.setAttrValue(attrValueEntry.data(),
+                                      attrValueEntry.size(), false);
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
     auto attrValueTable = biosConfig.getBIOSTable(PLDM_BIOS_ATTR_VAL_TABLE);
