diff --git a/redfish-core/include/registries.hpp b/redfish-core/include/registries.hpp
index 4247aa8..d3d6c5f 100644
--- a/redfish-core/include/registries.hpp
+++ b/redfish-core/include/registries.hpp
@@ -15,6 +15,8 @@
 */
 #pragma once
 
+#include <nlohmann/json.hpp>
+
 #include <array>
 #include <charconv>
 #include <cstddef>
@@ -89,4 +91,33 @@
     return ret;
 }
 
+inline nlohmann::json::object_t
+    getLogFromRegistry(const Header& header,
+                       std::span<const MessageEntry> registry, size_t index,
+                       std::span<const std::string_view> args)
+{
+    const redfish::registries::MessageEntry& entry = registry[index];
+    // Intentionally make a copy of the string, so we can append in the
+    // parameters.
+    std::string msg = entry.second.message;
+    redfish::registries::fillMessageArgs(args, msg);
+    nlohmann::json jArgs = nlohmann::json::array();
+    for (const std::string_view arg : args)
+    {
+        jArgs.push_back(arg);
+    }
+    std::string msgId = header.id;
+    msgId += ".";
+    msgId += entry.first;
+
+    nlohmann::json::object_t response;
+    response["@odata.type"] = "#Message.v1_1_1.Message";
+    response["MessageId"] = std::move(msgId);
+    response["Message"] = std::move(msg);
+    response["MessageArgs"] = std::move(jArgs);
+    response["MessageSeverity"] = entry.second.messageSeverity;
+    response["Resolution"] = entry.second.resolution;
+    return response;
+}
+
 } // namespace redfish::registries
diff --git a/redfish-core/include/resource_messages.hpp b/redfish-core/include/resource_messages.hpp
index 95ace94..e66ae6f 100644
--- a/redfish-core/include/resource_messages.hpp
+++ b/redfish-core/include/resource_messages.hpp
@@ -1,41 +1,43 @@
 #pragma once
 
+#include <nlohmann/json.hpp>
+#include <registries/resource_event_message_registry.hpp>
+
 namespace redfish
 {
 namespace messages
 {
 
+nlohmann::json
+    getLogResourceEvent(redfish::registries::resource_event::Index name,
+                        std::span<const std::string_view> args)
+{
+    size_t index = static_cast<size_t>(name);
+    if (index >= redfish::registries::resource_event::registry.size())
+    {
+        return {};
+    }
+    return getLogFromRegistry(redfish::registries::resource_event::header,
+                              redfish::registries::resource_event::registry,
+                              index, args);
+}
+
 inline nlohmann::json resourceChanged()
 {
-    return nlohmann::json{
-        {"EventType", "ResourceChanged"},
-        {"MessageId", "ResourceEvent.1.0.3.ResourceChanged"},
-        {"Message", "One or more resource properties have changed."},
-        {"MessageArgs", {}},
-        {"Severity", "OK"},
-        {"MessageSeverity", "OK"}};
+    return getLogResourceEvent(
+        redfish::registries::resource_event::Index::resourceChanged, {});
 }
 
 inline nlohmann::json resourceCreated()
 {
-    return nlohmann::json{
-        {"EventType", "ResourceAdded"},
-        {"MessageId", "ResourceEvent.1.0.3.ResourceCreated"},
-        {"Message", "The resource has been created successfully."},
-        {"MessageArgs", {}},
-        {"Severity", "OK"},
-        {"MessageSeverity", "OK"}};
+    return getLogResourceEvent(
+        redfish::registries::resource_event::Index::resourceCreated, {});
 }
 
 inline nlohmann::json resourceRemoved()
 {
-    return nlohmann::json{
-        {"EventType", "ResourceRemoved"},
-        {"MessageId", "ResourceEvent.1.0.3.ResourceRemoved"},
-        {"Message", "The resource has been removed successfully."},
-        {"MessageArgs", {}},
-        {"Severity", "OK"},
-        {"MessageSeverity", "OK"}};
+    return getLogResourceEvent(
+        redfish::registries::resource_event::Index::resourceCreated, {});
 }
 
 } // namespace messages
