diff --git a/watchdog/ffdc_file.cpp b/watchdog/ffdc_file.cpp
index bcc016f..5aaa92a 100644
--- a/watchdog/ffdc_file.cpp
+++ b/watchdog/ffdc_file.cpp
@@ -6,9 +6,8 @@
 #include <sys/stat.h>  // for open()
 #include <sys/types.h> // for open()
 
-#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/lg2.hpp>
 
-#include <format>
 #include <stdexcept>
 #include <string>
 
@@ -16,7 +15,6 @@
 {
 namespace dump
 {
-using namespace phosphor::logging;
 
 FFDCFile::FFDCFile(const json& calloutDataObject) :
     calloutData(calloutDataObject.dump())
@@ -29,9 +27,8 @@
     // Close file descriptor.  Does nothing if descriptor was already closed.
     if (descriptor.close() == -1)
     {
-        log<level::ERR>(std::format("Unable to close FFDC file: errormsg({})",
-                                    strerror(errno))
-                            .c_str());
+        lg2::error("Unable to close FFDC file: errormsg({ERRORMSG})",
+                   "ERRORMSG", strerror(errno));
     }
 
     // Delete temporary file.  Does nothing if file was already deleted.
@@ -52,33 +49,30 @@
 
     if (rc == -1)
     {
-        log<level::ERR>(std::format("Failed to write callout info "
-                                    "in file({}), errorno({}), errormsg({})",
-                                    tempFile.getPath().c_str(), errno,
-                                    strerror(errno))
-                            .c_str());
+        lg2::error("Failed to write callout info in file({FILE}), "
+                   "errorno({ERRNO}), errormsg({ERRORMSG})",
+                   "FILE", tempFile.getPath(), "ERRNO", errno, "ERRORMSG",
+                   strerror(errno));
+
         throw std::runtime_error("Failed to write phalPELCallouts info");
     }
     else if (rc != static_cast<ssize_t>(calloutData.size()))
     {
-        log<level::WARNING>(std::format("Could not write all callout "
-                                        "info in file({}), written byte({}) "
-                                        "and total byte({})",
-                                        tempFile.getPath().c_str(), rc,
-                                        calloutData.size())
-                                .c_str());
+        lg2::warning("Could not write all callout info in file({FILE}), "
+                     "written byte({WRITTEN}), total byte({TOTAL})",
+                     "FILE", tempFile.getPath(), "WRITTEN", rc, "TOTAL",
+                     calloutData.size());
     }
 
     int retCode = lseek(fd, 0, SEEK_SET);
 
     if (retCode == -1)
     {
-        log<level::ERR>(
-            std::format("Failed to seek file postion to the beginning"
-                        "in file({}), errorno({}) "
-                        "and errormsg({})",
-                        tempFile.getPath().c_str(), errno, strerror(errno))
-                .c_str());
+        lg2::error("Failed to seek file position to the beginning in "
+                   "file({FILE}), errorno({ERRNO}), errormsg({ERRORMSG})",
+                   "FILE", tempFile.getPath(), "ERRNO", errno, "ERRORMSG",
+                   strerror(errno));
+
         throw std::runtime_error(
             "Failed to seek file postion to the beginning of the file");
     }
diff --git a/watchdog/watchdog_dbus.cpp b/watchdog/watchdog_dbus.cpp
index 1606be1..ed7e750 100644
--- a/watchdog/watchdog_dbus.cpp
+++ b/watchdog/watchdog_dbus.cpp
@@ -1,10 +1,9 @@
 #include <unistd.h>
 
-#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/lg2.hpp>
 #include <watchdog_dbus.hpp>
 #include <watchdog_logging.hpp>
 
-#include <format>
 #include <string>
 #include <vector>
 
@@ -13,8 +12,6 @@
 namespace dump
 {
 
-using namespace phosphor::logging;
-
 int dbusMethod(const std::string& path, const std::string& interface,
                const std::string& function, sdbusplus::message_t& method,
                const std::string& extended)
@@ -71,16 +68,16 @@
         else
         {
             // This trace will be picked up in event log
-            log<level::INFO>("dbusMethod service not found");
+            lg2::info("dbusMethod service not found");
             std::string traceMsgPath = std::string(path, maxTraceLen);
-            log<level::INFO>(traceMsgPath.c_str());
+            lg2::info(traceMsgPath.c_str());
             std::string traceMsgIface = std::string(interface, maxTraceLen);
-            log<level::INFO>(traceMsgIface.c_str());
+            lg2::info(traceMsgIface.c_str());
         }
     }
     catch (const sdbusplus::exception_t& e)
     {
-        log<level::ERR>("Error in dbusMethod", entry("ERROR=%s", e.what()));
+        lg2::error("Error in dbusMethod ({ERROR})", "ERROR", e);
     }
 
     return rc;
@@ -122,8 +119,8 @@
         }
         catch (const sdbusplus::exception_t& e)
         {
-            log<level::ERR>("Error in createPel CreatePELWithFFDCFiles",
-                            entry("ERROR=%s", e.what()));
+            lg2::error("Error in createPel CreatePELWithFFDCFiles ({ERROR})",
+                       "ERROR", e);
         }
     }
 
@@ -159,10 +156,8 @@
         }
         catch (const sdbusplus::exception_t& e)
         {
-            log<level::ERR>(
-                std::format("Failed to read CurrentHostState property ({})",
-                            e.what())
-                    .c_str());
+            lg2::error("Failed to read CurrentHostState property ({ERROR})",
+                       "ERROR", e);
         }
     }
 
diff --git a/watchdog/watchdog_handler.cpp b/watchdog/watchdog_handler.cpp
index b3e1520..c94059f 100644
--- a/watchdog/watchdog_handler.cpp
+++ b/watchdog/watchdog_handler.cpp
@@ -1,19 +1,15 @@
-#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/lg2.hpp>
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/bus/match.hpp>
 #include <watchdog_dbus.hpp>
 #include <watchdog_handler.hpp>
 #include <watchdog_logging.hpp>
 
-#include <format>
-
 namespace watchdog
 {
 namespace dump
 {
 
-using namespace phosphor::logging;
-
 /**
  * @brief Callback for dump request properties change signal monitor
  *
@@ -44,8 +40,8 @@
         {
             // dump is not in InProgress state, trace some info and change in
             // progress status
-            log<level::INFO>(path.c_str());
-            log<level::INFO>((*status).c_str());
+            lg2::info("{PATH}", "PATH", path);
+            lg2::info("{STATUS}", "STATUS", *status);
 
             if ("xyz.openbmc_project.Common.Progress.OperationStatus."
                 "Completed" == *status)
@@ -106,16 +102,16 @@
 
     if (timedOut)
     {
-        log<level::ERR>("Dump progress status did not change to "
-                        "complete within the timeout interval, exiting...");
+        lg2::error("Dump progress status did not change to "
+                   "complete within the timeout interval, exiting...");
     }
     else if (DumpProgressStatus::Completed == progressStatus)
     {
-        log<level::INFO>("dump collection completed");
+        lg2::info("dump collection completed");
     }
     else
     {
-        log<level::INFO>("dump collection failed");
+        lg2::info("dump collection failed");
     }
 }
 
@@ -138,13 +134,13 @@
                 uint64_t(dumpParameters.logId);
             if (DumpType::Hostboot == dumpParameters.dumpType)
             {
-                log<level::INFO>("hostboot dump requested");
+                lg2::info("hostboot dump requested");
                 createParams["com.ibm.Dump.Create.CreateParameters.DumpType"] =
                     "com.ibm.Dump.Create.DumpType.Hostboot";
             }
             else if (DumpType::SBE == dumpParameters.dumpType)
             {
-                log<level::INFO>("SBE dump requested");
+                lg2::info("SBE dump requested");
                 createParams["com.ibm.Dump.Create.CreateParameters.DumpType"] =
                     "com.ibm.Dump.Create.DumpType.SBE";
                 createParams
@@ -172,19 +168,15 @@
             if (e.name() == ERROR_DUMP_DISABLED)
             {
                 // Dump is disabled, Skip the dump collection.
-                log<level::INFO>(
-                    std::format(
-                        "Dump is disabled on({}), skipping dump collection",
-                        dumpParameters.unitId)
-                        .c_str());
+                lg2::info("Dump is disabled on({UNIT}), "
+                          "skipping dump collection",
+                          "UNIT", dumpParameters.unitId);
             }
             else
             {
-                log<level::ERR>(
-                    std::format("D-Bus call createDump exception ",
-                                "OBJPATH={}, INTERFACE={}, EXCEPTION={}", path,
-                                interface, e.what())
-                        .c_str());
+                lg2::error("D-Bus call createDump exception OBJPATH={OBJPATH}, "
+                           "INTERFACE={INTERFACE}, EXCEPTION={ERROR}",
+                           "OBJPATH", path, "INTERFACE", interface, "ERROR", e);
             }
         }
     }
diff --git a/watchdog/watchdog_main.cpp b/watchdog/watchdog_main.cpp
index 7ad1ced..b124be3 100644
--- a/watchdog/watchdog_main.cpp
+++ b/watchdog/watchdog_main.cpp
@@ -7,7 +7,7 @@
 
 #include <libphal.H>
 
-#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/lg2.hpp>
 #include <watchdog_common.hpp>
 #include <watchdog_dbus.hpp>
 #include <watchdog_handler.hpp>
@@ -18,8 +18,6 @@
 namespace dump
 {
 
-using namespace phosphor::logging;
-
 void triggerHostbootDump(const uint32_t timeout)
 {
     constexpr auto HOST_STATE_DIAGNOSTIC_MODE =
@@ -71,9 +69,8 @@
     }
     catch (const std::exception& e)
     {
-        log<level::ERR>(std::format("getLocationCode({}): Exception({})",
-                                    pdbg_target_path(procTarget), e.what())
-                            .c_str());
+        lg2::error("getLocationCode({LOCATION}): Exception({ERROR})",
+                   "LOCATION", pdbg_target_path(procTarget), "ERROR", e);
     }
 }
 
@@ -92,8 +89,7 @@
     catch (const std::exception& e)
     {
         // Failed to collect FFDC information
-        log<level::ERR>(
-            std::format("captureFFDC: Exception{}", e.what()).c_str());
+        lg2::error("captureFFDC: Exception{ERROR}", "ERROR", e);
         dumpIsRequired = true;
     }
 
@@ -102,13 +98,13 @@
     if ((sbeError.errType() == exception::SBE_FFDC_NO_DATA) ||
         (sbeError.errType() == exception::SBE_CMD_TIMEOUT) || (dumpIsRequired))
     {
-        log<level::INFO>("No FFDC data");
+        lg2::info("No FFDC data");
         event = "org.open_power.Processor.Error.SbeBootTimeout";
         dumpIsRequired = true;
     }
     else
     {
-        log<level::ERR>("SBE Boot failure");
+        lg2::error("SBE Boot failure");
         event = "org.open_power.Processor.Error.SbeBootFailure";
     }
 
@@ -156,10 +152,8 @@
     }
     catch (const std::exception& e)
     {
-        log<level::ERR>(
-            std::format("Skipping SBE special callout due to Exception({})",
-                        e.what())
-                .c_str());
+        lg2::error("Skipping SBE special callout due to Exception({ERROR})",
+                   "ERROR", e);
     }
     auto pelId = createPel(event, additionalData, ffdc);
 
@@ -174,15 +168,14 @@
             if (!dumpAllowed)
             {
                 // Possibly another collection in progress, skip dump collection
-                log<level::INFO>("Another collection is in progress, skipping "
-                                 "dump collection");
+                lg2::error("Another collection is in progress, skipping "
+                           "dump collection");
                 return;
             }
         }
         catch (const std::exception& e)
         {
-            log<level::ERR>(
-                std::format("Exception {} occurred", e.what()).c_str());
+            lg2::error("Exception {ERROR} occurred", "ERROR", e);
             return;
         }
 
diff --git a/watchdog_timeout.cpp b/watchdog_timeout.cpp
index 91fa616..f616312 100644
--- a/watchdog_timeout.cpp
+++ b/watchdog_timeout.cpp
@@ -11,12 +11,11 @@
 
 #include <libphal.H>
 
-#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/lg2.hpp>
 #include <watchdog/watchdog_common.hpp>
 #include <watchdog/watchdog_dbus.hpp>
 #include <watchdog/watchdog_main.hpp>
 
-#include <format>
 #else
 #include <org/open_power/Host/Boot/error.hpp>
 #include <phosphor-logging/elog-errors.hpp>
@@ -37,10 +36,9 @@
     CLI11_PARSE(app, argc, argv);
 
 #ifdef WATCHDOG_DUMP_COLLECTION
-    using namespace phosphor::logging;
     using namespace watchdog::dump;
 
-    log<level::INFO>("Host did not respond within watchdog timeout interval");
+    lg2::info("Host did not respond within watchdog timeout interval");
     try
     {
         using namespace openpower::phal;
@@ -58,26 +56,26 @@
             // Collect hostboot dump only if the host is in 'Running' state
             if (!isHostStateRunning())
             {
-                log<level::INFO>(
+                lg2::info(
                     "CurrentHostState is not in 'Running' state. Dump maybe "
                     "already occurring, skipping this dump request...");
                 return EXIT_SUCCESS;
             }
 
             // SBE boot done, Need to collect hostboot dump
-            log<level::INFO>("Handle Hostboot boot failure");
+            lg2::info("Handle Hostboot boot failure");
             triggerHostbootDump(timeout);
         }
         else
         {
             // SBE boot window, handle SBE boot failure
-            log<level::INFO>("Handle SBE boot failure");
+            lg2::info("Handle SBE boot failure");
             handleSbeBootError(procTarget, timeout);
         }
     }
     catch (const std::exception& e)
     {
-        log<level::ERR>(std::format("Exception {} occurred", e.what()).c_str());
+        lg2::error("Exception {ERROR} occurred", "ERROR", e);
         std::string eventType =
             "org.open_power.Host.Boot.Error.WatchdogTimedOut";
         auto ffdc = std::vector<FFDCTuple>{};
@@ -85,7 +83,7 @@
 
         if (!createPel(eventType, additionalData, ffdc))
         {
-            log<level::ERR>("Failed to create PEL");
+            lg2::error("Failed to create PEL");
         }
 
         return EXIT_SUCCESS;
