Class LoggerAuditEventRepository

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

public class LoggerAuditEventRepository extends FilteringAuditEventRepository
A AuditEventRepository that logs to a named logger.
Author:
Martin Lindström
  • Constructor Details

    • LoggerAuditEventRepository

      public LoggerAuditEventRepository(@Nonnull String loggerName, @Nullable org.slf4j.event.Level logLevel, @Nonnull AuditEventMapper eventMapper)
      Constructor mapping to LoggerAuditEventRepository(String, Level, AuditEventMapper, Predicate) where the filter allows all events.
      Parameters:
      loggerName - the name of the logger
      logLevel - the log level to use (INFO is defaylt)
      eventMapper - the event mapper used to map events to strings
    • LoggerAuditEventRepository

      public LoggerAuditEventRepository(@Nonnull String loggerName, @Nullable org.slf4j.event.Level logLevel, @Nonnull AuditEventMapper eventMapper, @Nullable Predicate<org.springframework.boot.actuate.audit.AuditEvent> filter)
      Constructor.
      Parameters:
      loggerName - the name of the logger
      logLevel - the log level to use (INFO is defaylt)
      eventMapper - the event mapper used to map events to strings
      filter - filter for determining which events to log
  • Method Details

    • addEvent

      protected 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)
      Will always return an empty list.