diff --git a/components/logging/org.wso2.carbon.logging.service/src/main/java/org/wso2/carbon/logging/service/provider/InMemoryLogProvider.java b/components/logging/org.wso2.carbon.logging.service/src/main/java/org/wso2/carbon/logging/service/provider/InMemoryLogProvider.java index 739b7594eb..84de665254 100644 --- a/components/logging/org.wso2.carbon.logging.service/src/main/java/org/wso2/carbon/logging/service/provider/InMemoryLogProvider.java +++ b/components/logging/org.wso2.carbon.logging.service/src/main/java/org/wso2/carbon/logging/service/provider/InMemoryLogProvider.java @@ -234,6 +234,12 @@ public int logsCount(String tenantDomain, String serverKey) throws LogViewerExce @Override public boolean clearLogs() { + Appender appender = Logger.getRootLogger().getAppender(LoggingConstants.WSO2CARBON_MEMORY_APPENDER); + if (appender instanceof CarbonMemoryAppender) { + CarbonMemoryAppender memoryAppender = (CarbonMemoryAppender) appender; + memoryAppender.getCircularQueue().clear(); + return true; + } return false; }