diff --git a/vpd-manager/include/logger.hpp b/vpd-manager/include/logger.hpp
index a4160c1..bedc688 100644
--- a/vpd-manager/include/logger.hpp
+++ b/vpd-manager/include/logger.hpp
@@ -1,13 +1,124 @@
 #pragma once
 
+#include "types.hpp"
+
 #include <iostream>
+#include <memory>
 #include <source_location>
 #include <string_view>
 
 namespace vpd
 {
+
+/**
+ * @brief Enum class defining placeholder tags.
+ *
+ * The tag will be used by APIs to identify the endpoint for a given log
+ * message.
+ */
+enum class PlaceHolder
+{
+    DEFAULT,   /* logs to the journal */
+    PEL,       /* Creates a PEL */
+    COLLECTION /* Logs collection messages */
+};
+
+/**
+ * @brief Class to handle file operations w.r.t logging.
+ * Based on the placeholder the class will handle different file operations to
+ * log error messages.
+ */
+class LogFileHandler
+{
+    // should hold fd's for files required as per placeholder.
+  public:
+    /**
+     * @brief API exposed to write a log message to a file.
+     *
+     * The API can be called by logger class in case log message needs to be
+     * redirected to a file. The endpoint can be decided based on the
+     * placeholder passed to the API.
+     *
+     * @param[in] i_placeHolder - Information about the endpoint.
+     */
+    void writeLogToFile([[maybe_unused]] const PlaceHolder& i_placeHolder)
+    {
+        // Handle the file operations.
+    }
+
+    // Frined class Logger.
+    friend class Logger;
+
+  private:
+    /**
+     * @brief Constructor
+     * Private so that can't be initialized by class(es) other than friends.
+     */
+    LogFileHandler() {}
+
+    /* Define APIs to handle file operation as per the placeholder. */
+};
+
+/**
+ * @brief Singleton class to handle error logging for the repository.
+ */
+class Logger
+{
+  public:
+    /**
+     * @brief Deleted Methods
+     */
+    Logger(const Logger&) = delete;  // Copy constructor
+    Logger(const Logger&&) = delete; // Move constructor
+
+    /**
+     * @brief Method to get instance of Logger class.
+     */
+    static std::shared_ptr<Logger> getLoggerInstance()
+    {
+        if (!m_loggerInstance)
+        {
+            m_loggerInstance = std::shared_ptr<Logger>(new Logger());
+        }
+        return m_loggerInstance;
+    }
+
+    /**
+     * @brief API to log a given error message.
+     *
+     * @param[in] i_message - Message to be logged.
+     * @param[in] i_placeHolder - States where the message needs to be logged.
+     * Default is journal.
+     * @param[in] i_pelTuple - A structure only required in case message needs
+     * to be logged as PEL.
+     * @param[in] i_location - Locatuon from where message needs to be logged.
+     */
+    void logMessage(std::string_view i_message,
+                    const PlaceHolder& i_placeHolder = PlaceHolder::DEFAULT,
+                    const types::PelInfoTuple* i_pelTuple = nullptr,
+                    const std::source_location& i_location =
+                        std::source_location::current());
+
+  private:
+    /**
+     * @brief Constructor
+     */
+    Logger() : m_logFileHandler(nullptr)
+    {
+        m_logFileHandler =
+            std::shared_ptr<LogFileHandler>(new LogFileHandler());
+    }
+
+    // Instance to the logger class.
+    static std::shared_ptr<Logger> m_loggerInstance;
+
+    // Instance to LogFileHandler class.
+    std::shared_ptr<LogFileHandler> m_logFileHandler;
+};
+
 /**
  * @brief The namespace defines logging related methods for VPD.
+ * Only for backward compatibility till new logger class comes up.
  */
 namespace logging
 {
