bmcweb: fix "Clear Event Logs" functionality behavior in System logs page on WebUI
When BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES option set to ON that means bmcweb will look to phosphor-logging for any D-Bus log entries.
These will then be translated to Redfish EventLog Entries. Thus, we can see those Redfish Eventlog Entries when select "Event" system log type in System logs page.
However, when this option set to ON, the "Clear Event Logs" functionality still clear /var/log/redfish file instead of
clear log through xyz.openbmc_project.Collection.DeleteAll interface by DeleteAll action.
It should to clear D-Bus log entries when BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES option is ON.
Thus, we provide our modification for correct this functionality behavior.
Tested by: Nuvoton NPCM750 EVB and RunBMC Olympus platforms in WebUI.
when BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES option is ON to clear D-Bus log entries,
and when option is OFF to clear /var/log/redfish log entries.
Signed-off-by: Tim Lee <timlee660101@gmail.com>
Change-Id: I71445806ae5a79c2c0622908f7ac60daaa2119b8
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 233578e..d08d6d0 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -508,10 +508,10 @@
}
};
-class EventLogClear : public Node
+class JournalEventLogClear : public Node
{
public:
- EventLogClear(CrowApp &app) :
+ JournalEventLogClear(CrowApp &app) :
Node(app, "/redfish/v1/Systems/system/LogServices/EventLog/Actions/"
"LogService.ClearLog/")
{
@@ -1894,7 +1894,7 @@
public:
DBusLogServiceActionsClear(CrowApp &app) :
Node(app, "/redfish/v1/Systems/system/LogServices/EventLog/Actions/"
- "LogService.Reset")
+ "LogService.ClearLog")
{
entityPrivileges = {
{boost::beast::http::verb::get, {{"Login"}}},