X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.auditlogging%2Fsrc%2Forg%2Fsimantics%2Faudit%2FAuditLogging.java;fp=bundles%2Forg.simantics.auditlogging%2Fsrc%2Forg%2Fsimantics%2Faudit%2FAuditLogging.java;h=3cd6ac3921ecfc9107166775ab3ee42ebeaf778b;hp=334e19c4762787ca579db78da236687ae6b53f79;hb=a270cece5fc71b6e3ca7f58ed21b297b017029fc;hpb=e5a7fd11c1a61fcfcbf481bf01ea8781feeb2b72 diff --git a/bundles/org.simantics.auditlogging/src/org/simantics/audit/AuditLogging.java b/bundles/org.simantics.auditlogging/src/org/simantics/audit/AuditLogging.java index 334e19c47..3cd6ac392 100644 --- a/bundles/org.simantics.auditlogging/src/org/simantics/audit/AuditLogging.java +++ b/bundles/org.simantics.auditlogging/src/org/simantics/audit/AuditLogging.java @@ -41,6 +41,24 @@ public class AuditLogging { } } + public static Map> allLogEvents(String level, int days) throws AuditLoggingException { + Map> results = new HashMap<>(); + try { + Files.walk(Activator.getLogLocation()).forEach(uuid -> { + String fileName = uuid.getFileName().toString(); + try { + List events = getLogEventsDays(fileName, level, days); + results.put(fileName, events); + } catch (AuditLoggingException e) { + LOGGER.error("Could not get audit log events for {}", fileName, e); + } + }); + } catch (IOException e) { + throw new AuditLoggingException(e); + } + return results; + } + /** * Gets audit events for the last 5 days *