diff --git a/redfish-core/include/task_messages.hpp b/redfish-core/include/task_messages.hpp
new file mode 100644
index 0000000..050cc63
--- /dev/null
+++ b/redfish-core/include/task_messages.hpp
@@ -0,0 +1,125 @@
+/*
+// Copyright (c) 2020 Intel Corporation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+*/
+
+namespace redfish
+{
+
+namespace messages
+{
+
+nlohmann::json taskAborted(const std::string& arg1)
+{
+    return nlohmann::json{
+        {"@odata.type", "#Message.v1_0_0.Message"},
+        {"MessageId", "TaskEvent.1.0.1.TaskAborted"},
+        {"Message", "The task with id " + arg1 + " has been aborted."},
+        {"MessageArgs", {arg1}},
+        {"Severity", "Critical"},
+        {"Resolution", "None."}};
+}
+
+nlohmann::json taskCancelled(const std::string& arg1)
+{
+    return nlohmann::json{
+        {"@odata.type", "#Message.v1_0_0.Message"},
+        {"MessageId", "TaskEvent.1.0.1.TaskCancelled"},
+        {"Message", "The task with id " + arg1 + " has been cancelled."},
+        {"MessageArgs", {arg1}},
+        {"Severity", "Warning"},
+        {"Resolution", "None."}};
+}
+
+nlohmann::json taskCompletedOK(const std::string& arg1)
+{
+    return nlohmann::json{
+        {"@odata.type", "#Message.v1_0_0.Message"},
+        {"MessageId", "TaskEvent.1.0.1.TaskCompletedOK"},
+        {"Message", "The task with id " + arg1 + " has Completed."},
+        {"MessageArgs", {arg1}},
+        {"Severity", "OK"},
+        {"Resolution", "None."}};
+}
+
+nlohmann::json taskCompletedWarning(const std::string& arg1)
+{
+    return nlohmann::json{{"@odata.type", "#Message.v1_0_0.Message"},
+                          {"MessageId", "TaskEvent.1.0.1.TaskCompletedWarning"},
+                          {"Message", "The task with id " + arg1 +
+                                          " has completed with warnings."},
+                          {"MessageArgs", {arg1}},
+                          {"Severity", "Warning"},
+                          {"Resolution", "None."}};
+}
+
+nlohmann::json taskPaused(const std::string& arg1)
+{
+    return nlohmann::json{
+        {"@odata.type", "#Message.v1_0_0.Message"},
+        {"MessageId", "TaskEvent.1.0.1.TaskPaused"},
+        {"Message", "The task with id " + arg1 + " has been paused."},
+        {"MessageArgs", {arg1}},
+        {"Severity", "Warning"},
+        {"Resolution", "None."}};
+}
+
+nlohmann::json taskProgressChanged(const std::string& arg1, const size_t arg2)
+{
+    return nlohmann::json{
+        {"@odata.type", "#Message.v1_0_0.Message"},
+        {"MessageId", "TaskEvent.1.0.1.TaskProgressChanged"},
+        {"Message", "The task with id " + arg1 + " has changed to progress " +
+                        std::to_string(arg2) + " percent complete."},
+        {"MessageArgs", {arg1, arg2}},
+        {"Severity", "OK"},
+        {"Resolution", "None."}};
+}
+
+nlohmann::json taskRemoved(const std::string& arg1)
+{
+    return nlohmann::json{
+        {"@odata.type", "#Message.v1_0_0.Message"},
+        {"MessageId", "TaskEvent.1.0.1.TaskRemoved"},
+        {"Message", "The task with id " + arg1 + " has been removed."},
+        {"MessageArgs", {arg1}},
+        {"Severity", "Warning"},
+        {"Resolution", "None."}};
+}
+
+nlohmann::json taskResumed(const std::string& arg1)
+{
+    return nlohmann::json{
+        {"@odata.type", "#Message.v1_0_0.Message"},
+        {"MessageId", "TaskEvent.1.0.1.TaskResumed"},
+        {"Message", "The task with id " + arg1 + " has been resumed."},
+        {"MessageArgs", {arg1}},
+        {"Severity", "OK"},
+        {"Resolution", "None."}};
+}
+
+nlohmann::json taskStarted(const std::string& arg1)
+{
+    return nlohmann::json{
+        {"@odata.type", "#Message.v1_0_0.Message"},
+        {"MessageId", "TaskEvent.1.0.1.TaskStarted"},
+        {"Message", "The task with id " + arg1 + " has started."},
+        {"MessageArgs", {arg1}},
+        {"Severity", "OK"},
+        {"Resolution", "None."}};
+}
+
+} // namespace messages
+
+} // namespace redfish
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 667fb40..79433b9 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -2274,7 +2274,9 @@
                    const std::shared_ptr<task::TaskData> &taskData) {
                     if (!err)
                     {
-                        taskData->messages.emplace_back(messages::success());
+                        taskData->messages.emplace_back(
+                            messages::taskCompletedOK(
+                                std::to_string(taskData->index)));
                         taskData->state = "Completed";
                     }
                     return task::completed;
diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp
index 2f86a6a..cbae67b 100644
--- a/redfish-core/lib/task.hpp
+++ b/redfish-core/lib/task.hpp
@@ -20,6 +20,7 @@
 #include <boost/asio.hpp>
 #include <boost/container/flat_map.hpp>
 #include <chrono>
+#include <task_messages.hpp>
 #include <variant>
 
 namespace redfish
@@ -206,9 +207,11 @@
                 self->finishTask();
                 self->state = "Cancelled";
                 self->status = "Warning";
-                self->messages.emplace_back(messages::internalError());
+                self->messages.emplace_back(
+                    messages::taskAborted(std::to_string(self->index)));
                 self->callback(ec, msg, self);
             });
+        messages.emplace_back(messages::taskStarted(std::to_string(index)));
     }
 
     std::function<bool(boost::system::error_code, sdbusplus::message::message &,
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index e9793eb..60d6673 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -151,14 +151,16 @@
                                         return task::completed;
                                     }
 
+                                    std::string index =
+                                        std::to_string(taskData->index);
+
                                     if (boost::ends_with(*state, "Invalid") ||
                                         boost::ends_with(*state, "Failed"))
                                     {
                                         taskData->state = "Exception";
                                         taskData->status = "Warning";
                                         taskData->messages.emplace_back(
-                                            messages::invalidObject(
-                                                "/redfish/v1/UpdateService/"));
+                                            messages::taskAborted(index));
                                         return task::completed;
                                     }
 
@@ -171,7 +173,7 @@
                                     if (boost::ends_with(*state, "Active"))
                                     {
                                         taskData->messages.emplace_back(
-                                            messages::success());
+                                            messages::taskCompletedOK(index));
                                         taskData->state = "Completed";
                                         return task::completed;
                                     }
