diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7cde52e..cf20743 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,7 +31,7 @@
        Actions/Oem/CpuLog.SendRawPeci'." OFF)
 option (BMCWEB_ENABLE_REDFISH_CPU_LOG "Enable CPU log service transactions
        through Redfish.  Paths are under
-       '/redfish/v1/Systems/system/LogServices/CpuLog'." OFF)
+       '/redfish/v1/Systems/system/LogServices/Crashdump'." OFF)
 option (BMCWEB_ENABLE_REDFISH_ONE_CHASSIS "Enable Redfish to assume only one
        chassis is present.  All sensors will be assumed to be under this
        chassis.  The chassis path is '/redfish/v1/Chassis/chassis'." OFF)
diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp
index 49cface..866eaed 100644
--- a/redfish-core/include/redfish.hpp
+++ b/redfish-core/include/redfish.hpp
@@ -86,10 +86,10 @@
 #endif
 
 #ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
-        nodes.emplace_back(std::make_unique<CPULogService>(app));
-        nodes.emplace_back(std::make_unique<CPULogEntryCollection>(app));
-        nodes.emplace_back(std::make_unique<CPULogEntry>(app));
-        nodes.emplace_back(std::make_unique<OnDemandCPULog>(app));
+        nodes.emplace_back(std::make_unique<CrashdumpService>(app));
+        nodes.emplace_back(std::make_unique<CrashdumpEntryCollection>(app));
+        nodes.emplace_back(std::make_unique<CrashdumpEntry>(app));
+        nodes.emplace_back(std::make_unique<OnDemandCrashdump>(app));
 #ifdef BMCWEB_ENABLE_REDFISH_RAW_PECI
         nodes.emplace_back(std::make_unique<SendRawPECI>(app));
 #endif // BMCWEB_ENABLE_REDFISH_RAW_PECI
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index e30c8b0..d2e8e36 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -27,14 +27,14 @@
 namespace redfish
 {
 
-constexpr char const *cpuLogObject = "com.intel.CpuDebugLog";
-constexpr char const *cpuLogPath = "/com/intel/CpuDebugLog";
-constexpr char const *cpuLogOnDemandPath = "/com/intel/CpuDebugLog/OnDemand";
-constexpr char const *cpuLogInterface = "com.intel.CpuDebugLog";
-constexpr char const *cpuLogOnDemandInterface =
-    "com.intel.CpuDebugLog.OnDemand";
-constexpr char const *cpuLogRawPECIInterface =
-    "com.intel.CpuDebugLog.SendRawPeci";
+constexpr char const *CrashdumpObject = "com.intel.crashdump";
+constexpr char const *CrashdumpPath = "/com/intel/crashdump";
+constexpr char const *CrashdumpOnDemandPath = "/com/intel/crashdump/OnDemand";
+constexpr char const *CrashdumpInterface = "com.intel.crashdump";
+constexpr char const *CrashdumpOnDemandInterface =
+    "com.intel.crashdump.OnDemand";
+constexpr char const *CrashdumpRawPECIInterface =
+    "com.intel.crashdump.SendRawPeci";
 
 namespace fs = std::filesystem;
 
@@ -343,7 +343,7 @@
 #ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
         logServiceArray.push_back(
             {{ "@odata.id",
-               "/redfish/v1/Systems/system/LogServices/CpuLog" }});
+               "/redfish/v1/Systems/system/LogServices/Crashdump" }});
 #endif
         asyncResp->res.jsonValue["Members@odata.count"] =
             logServiceArray.size();
@@ -1158,12 +1158,12 @@
     }
 };
 
-class CPULogService : public Node
+class CrashdumpService : public Node
 {
   public:
     template <typename CrowApp>
-    CPULogService(CrowApp &app) :
-        Node(app, "/redfish/v1/Systems/system/LogServices/CpuLog/")
+    CrashdumpService(CrowApp &app) :
+        Node(app, "/redfish/v1/Systems/system/LogServices/Crashdump/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
@@ -1184,41 +1184,41 @@
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         // Copy over the static data to include the entries added by SubRoute
         asyncResp->res.jsonValue["@odata.id"] =
-            "/redfish/v1/Systems/system/LogServices/CpuLog";
+            "/redfish/v1/Systems/system/LogServices/Crashdump";
         asyncResp->res.jsonValue["@odata.type"] =
             "#LogService.v1_1_0.LogService";
         asyncResp->res.jsonValue["@odata.context"] =
             "/redfish/v1/$metadata#LogService.LogService";
-        asyncResp->res.jsonValue["Name"] = "Open BMC CPU Log Service";
-        asyncResp->res.jsonValue["Description"] = "CPU Log Service";
-        asyncResp->res.jsonValue["Id"] = "CPU Log";
+        asyncResp->res.jsonValue["Name"] = "Open BMC Crashdump Service";
+        asyncResp->res.jsonValue["Description"] = "Crashdump Service";
+        asyncResp->res.jsonValue["Id"] = "Crashdump";
         asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
         asyncResp->res.jsonValue["MaxNumberOfRecords"] = 3;
         asyncResp->res.jsonValue["Entries"] = {
             {"@odata.id",
-             "/redfish/v1/Systems/system/LogServices/CpuLog/Entries"}};
+             "/redfish/v1/Systems/system/LogServices/Crashdump/Entries"}};
         asyncResp->res.jsonValue["Actions"] = {
             {"Oem",
-             {{"#CpuLog.OnDemand",
-               {{"target", "/redfish/v1/Systems/system/LogServices/CpuLog/"
-                           "Actions/Oem/CpuLog.OnDemand"}}}}}};
+             {{"#Crashdump.OnDemand",
+               {{"target", "/redfish/v1/Systems/system/LogServices/Crashdump/"
+                           "Actions/Oem/Crashdump.OnDemand"}}}}}};
 
 #ifdef BMCWEB_ENABLE_REDFISH_RAW_PECI
         asyncResp->res.jsonValue["Actions"]["Oem"].push_back(
-            {"#CpuLog.SendRawPeci",
+            {"#Crashdump.SendRawPeci",
              { { "target",
-                 "/redfish/v1/Systems/system/LogServices/CpuLog/"
-                 "Actions/Oem/CpuLog.SendRawPeci" } }});
+                 "/redfish/v1/Systems/system/LogServices/Crashdump/"
+                 "Actions/Oem/Crashdump.SendRawPeci" } }});
 #endif
     }
 };
 
-class CPULogEntryCollection : public Node
+class CrashdumpEntryCollection : public Node
 {
   public:
     template <typename CrowApp>
-    CPULogEntryCollection(CrowApp &app) :
-        Node(app, "/redfish/v1/Systems/system/LogServices/CpuLog/Entries/")
+    CrashdumpEntryCollection(CrowApp &app) :
+        Node(app, "/redfish/v1/Systems/system/LogServices/Crashdump/Entries/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
@@ -1256,19 +1256,19 @@
             asyncResp->res.jsonValue["@odata.type"] =
                 "#LogEntryCollection.LogEntryCollection";
             asyncResp->res.jsonValue["@odata.id"] =
-                "/redfish/v1/Systems/system/LogServices/CpuLog/Entries";
+                "/redfish/v1/Systems/system/LogServices/Crashdump/Entries";
             asyncResp->res.jsonValue["@odata.context"] =
                 "/redfish/v1/"
                 "$metadata#LogEntryCollection.LogEntryCollection";
-            asyncResp->res.jsonValue["Name"] = "Open BMC CPU Log Entries";
+            asyncResp->res.jsonValue["Name"] = "Open BMC Crashdump Entries";
             asyncResp->res.jsonValue["Description"] =
-                "Collection of CPU Log Entries";
+                "Collection of Crashdump Entries";
             nlohmann::json &logEntryArray = asyncResp->res.jsonValue["Members"];
             logEntryArray = nlohmann::json::array();
             for (const std::string &objpath : resp)
             {
                 // Don't list the on-demand log
-                if (objpath.compare(cpuLogOnDemandPath) == 0)
+                if (objpath.compare(CrashdumpOnDemandPath) == 0)
                 {
                     continue;
                 }
@@ -1277,7 +1277,7 @@
                 {
                     logEntryArray.push_back(
                         {{"@odata.id", "/redfish/v1/Systems/system/LogServices/"
-                                       "CpuLog/Entries/" +
+                                       "Crashdump/Entries/" +
                                            objpath.substr(lastPos + 1)}});
                 }
             }
@@ -1289,14 +1289,14 @@
             "xyz.openbmc_project.ObjectMapper",
             "/xyz/openbmc_project/object_mapper",
             "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths", "", 0,
-            std::array<const char *, 1>{cpuLogInterface});
+            std::array<const char *, 1>{CrashdumpInterface});
     }
 };
 
-std::string getLogCreatedTime(const nlohmann::json &cpuLog)
+std::string getLogCreatedTime(const nlohmann::json &Crashdump)
 {
-    nlohmann::json::const_iterator cdIt = cpuLog.find("crashlog_data");
-    if (cdIt != cpuLog.end())
+    nlohmann::json::const_iterator cdIt = Crashdump.find("crashlog_data");
+    if (cdIt != Crashdump.end())
     {
         nlohmann::json::const_iterator siIt = cdIt->find("SYSTEM_INFO");
         if (siIt != cdIt->end())
@@ -1318,12 +1318,12 @@
     return std::string();
 }
 
-class CPULogEntry : public Node
+class CrashdumpEntry : public Node
 {
   public:
-    CPULogEntry(CrowApp &app) :
+    CrashdumpEntry(CrowApp &app) :
         Node(app,
-             "/redfish/v1/Systems/system/LogServices/CpuLog/Entries/<str>/",
+             "/redfish/v1/Systems/system/LogServices/Crashdump/Entries/<str>/",
              std::string())
     {
         entityPrivileges = {
@@ -1372,28 +1372,30 @@
                 {"@odata.type", "#LogEntry.v1_4_0.LogEntry"},
                 {"@odata.context", "/redfish/v1/$metadata#LogEntry.LogEntry"},
                 {"@odata.id",
-                 "/redfish/v1/Systems/system/LogServices/CpuLog/Entries/" +
+                 "/redfish/v1/Systems/system/LogServices/Crashdump/Entries/" +
                      std::to_string(logId)},
-                {"Name", "CPU Debug Log"},
+                {"Name", "CPU Crashdump"},
                 {"Id", logId},
                 {"EntryType", "Oem"},
-                {"OemRecordFormat", "Intel CPU Log"},
+                {"OemRecordFormat", "Intel Crashdump"},
                 {"Oem", {{"Intel", std::move(j)}}},
                 {"Created", std::move(t)}};
         };
         crow::connections::systemBus->async_method_call(
-            std::move(getStoredLogCallback), cpuLogObject,
-            cpuLogPath + std::string("/") + std::to_string(logId),
-            "org.freedesktop.DBus.Properties", "Get", cpuLogInterface, "Log");
+            std::move(getStoredLogCallback), CrashdumpObject,
+            CrashdumpPath + std::string("/") + std::to_string(logId),
+            "org.freedesktop.DBus.Properties", "Get", CrashdumpInterface,
+            "Log");
     }
 };
 
-class OnDemandCPULog : public Node
+class OnDemandCrashdump : public Node
 {
   public:
-    OnDemandCPULog(CrowApp &app) :
-        Node(app, "/redfish/v1/Systems/system/LogServices/CpuLog/Actions/Oem/"
-                  "CpuLog.OnDemand/")
+    OnDemandCrashdump(CrowApp &app) :
+        Node(app,
+             "/redfish/v1/Systems/system/LogServices/Crashdump/Actions/Oem/"
+             "Crashdump.OnDemand/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
@@ -1455,7 +1457,7 @@
                 interfacesAdded;
             m.read(objPath, interfacesAdded);
             const std::string *log = std::get_if<std::string>(
-                &interfacesAdded[cpuLogInterface]["Log"]);
+                &interfacesAdded[CrashdumpInterface]["Log"]);
             if (log == nullptr)
             {
                 messages::internalError(asyncResp->res);
@@ -1483,9 +1485,9 @@
             asyncResp->res.jsonValue = {
                 {"@odata.type", "#LogEntry.v1_4_0.LogEntry"},
                 {"@odata.context", "/redfish/v1/$metadata#LogEntry.LogEntry"},
-                {"Name", "CPU Debug Log"},
+                {"Name", "CPU Crashdump"},
                 {"EntryType", "Oem"},
-                {"OemRecordFormat", "Intel CPU Log"},
+                {"OemRecordFormat", "Intel Crashdump"},
                 {"Oem", {{"Intel", std::move(j)}}},
                 {"Created", std::move(t)}};
             // Careful with onDemandLogMatcher.  It is a unique_ptr to the
@@ -1498,7 +1500,8 @@
         onDemandLogMatcher = std::make_unique<sdbusplus::bus::match::match>(
             *crow::connections::systemBus,
             sdbusplus::bus::match::rules::interfacesAdded() +
-                sdbusplus::bus::match::rules::argNpath(0, cpuLogOnDemandPath),
+                sdbusplus::bus::match::rules::argNpath(0,
+                                                       CrashdumpOnDemandPath),
             std::move(onDemandLogMatcherCallback));
 
         auto generateonDemandLogCallback =
@@ -1527,8 +1530,8 @@
                 }
             };
         crow::connections::systemBus->async_method_call(
-            std::move(generateonDemandLogCallback), cpuLogObject, cpuLogPath,
-            cpuLogOnDemandInterface, "GenerateOnDemandLog");
+            std::move(generateonDemandLogCallback), CrashdumpObject,
+            CrashdumpPath, CrashdumpOnDemandInterface, "GenerateOnDemandLog");
     }
 };
 
@@ -1536,8 +1539,9 @@
 {
   public:
     SendRawPECI(CrowApp &app) :
-        Node(app, "/redfish/v1/Systems/system/LogServices/CpuLog/Actions/Oem/"
-                  "CpuLog.SendRawPeci/")
+        Node(app,
+             "/redfish/v1/Systems/system/LogServices/Crashdump/Actions/Oem/"
+             "Crashdump.SendRawPeci/")
     {
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"ConfigureComponents"}}},
@@ -1579,8 +1583,8 @@
             };
         // Call the SendRawPECI command with the provided data
         crow::connections::systemBus->async_method_call(
-            std::move(sendRawPECICallback), cpuLogObject, cpuLogPath,
-            cpuLogRawPECIInterface, "SendRawPeci", clientAddress, readLength,
+            std::move(sendRawPECICallback), CrashdumpObject, CrashdumpPath,
+            CrashdumpRawPECIInterface, "SendRawPeci", clientAddress, readLength,
             peciCommand);
     }
 };
