Class FileBasedAuditEventRepository

java.lang.Object
se.swedenconnect.spring.saml.idp.audit.repository.FilteringAuditEventRepository
se.swedenconnect.spring.saml.idp.audit.repository.FileBasedAuditEventRepository
All Implemented Interfaces:
org.springframework.boot.actuate.audit.AuditEventRepository

public class FileBasedAuditEventRepository extends FilteringAuditEventRepository
A write-only AuditEventRepository that writes audit events to a file.
Author:
Martin Lindström
  • Constructor Details

    • FileBasedAuditEventRepository

      public FileBasedAuditEventRepository(String logFile, AuditEventMapper eventMapper) throws IOException
      Constructor mapping to FileBasedAuditEventRepository(String, AuditEventMapper, Predicate) where the filter allows all events.
      Parameters:
      logFile - the log file including its path
      eventMapper - the event mapper used to map events to strings
      Throws:
      IOException - if the logfile is invalid
    • FileBasedAuditEventRepository

      public FileBasedAuditEventRepository(String logFile, AuditEventMapper eventMapper, Predicate<org.springframework.boot.actuate.audit.AuditEvent> filter) throws IOException
      Constructor.
      Parameters:
      logFile - the log file including its path
      eventMapper - the event mapper used to map events to strings
      filter - filter for determining which events to log
      Throws:
      IOException - if the logfile is invalid
  • Method Details

    • addEvent

      public void addEvent(org.springframework.boot.actuate.audit.AuditEvent event)
      Logs an event.
      Specified by:
      addEvent in class FilteringAuditEventRepository
      Parameters:
      event - the audit event to log
    • find

      public List<org.springframework.boot.actuate.audit.AuditEvent> find(String principal, Instant after, String type)