Class AuditLogger.Builder

  • Enclosing class:
    AuditLogger

    public static class AuditLogger.Builder
    extends Object
    A builder for audit logger instances.
    • Method Detail

      • setPriorityMapper

        public AuditLogger.Builder setPriorityMapper​(Function<SecurityEvent,​EventPriority> priorityMapper)
        Set the priority mapper to assign a priority to the messages.
        Parameters:
        priorityMapper - the priority mapper to assign a priority to the messages.
        Returns:
        this builder.
      • setMessageFormatter

        public AuditLogger.Builder setMessageFormatter​(Function<SecurityEvent,​String> messageFormatter)
        Set the message formatter to convert the messages to formatted Strings.
        Parameters:
        messageFormatter - the message formatter to convert the messages to formatted Strings.
        Returns:
        this builder.
      • build

        public Consumer<SecurityEvent> build()
        Construct a new audit logger instance.
        Returns:
        the built audit logger.