Class SizeRotatingFileAuditEndpoint.Builder

java.lang.Object
org.wildfly.security.audit.FileAuditEndpoint.Builder
org.wildfly.security.audit.SizeRotatingFileAuditEndpoint.Builder
Enclosing class:
SizeRotatingFileAuditEndpoint

public static class SizeRotatingFileAuditEndpoint.Builder extends FileAuditEndpoint.Builder
A builder for size rotating file audit endpoints.
  • Method Details

    • setRotateSize

      public SizeRotatingFileAuditEndpoint.Builder setRotateSize(long rotateSize)
      Set the log file size the file should rotate at.
      Parameters:
      rotateSize - the size the file should rotate at
      Returns:
      this builder.
    • setSuffix

      public SizeRotatingFileAuditEndpoint.Builder setSuffix(String suffix)
      Sets the suffix to be appended to the file name during the file rotation. The suffix does not play a role in determining when the file should be rotated.

      The suffix must be a string understood by the DateTimeFormatter.

      Note: Files will be rotated for the same suffix until reach the maximum backup index configured by setMaxBackupIndex(int). If the suffix is resolved to a new value, any files rotated with a different suffix will not be deleted. For example if the suffix is .yyyy-DD-mm, the maximum size was reached 20 times on the same day and the maxBackupIndex was set to 10, then there will only be 10 files kept. What will not be purged is files from a previous day.

      Parameters:
      suffix - the suffix to place after the filename when the file is rotated
    • setMaxBackupIndex

      public SizeRotatingFileAuditEndpoint.Builder setMaxBackupIndex(int maxBackupIndex)
      Set the maximum number of files to backup.
      Parameters:
      maxBackupIndex - the maximum number of files to backup
      Returns:
      this builder.
    • setRotateOnBoot

      public SizeRotatingFileAuditEndpoint.Builder setRotateOnBoot(boolean rotateOnBoot)
      Set to a value of true if the file should be rotated before the a new file is set. The rotation only happens if the file names are the same and the file has a length greater than 0.
      Parameters:
      rotateOnBoot - true to rotate on boot, otherwise false
      Returns:
      this builder.
    • setTimeZone

      public SizeRotatingFileAuditEndpoint.Builder setTimeZone(ZoneId timeZone)
      Set the configured time zone for this handler.
      Parameters:
      timeZone - the configured time zone
      Returns:
      this builder.
    • build

      public AuditEndpoint build() throws IOException
      Construct a new instance.
      Overrides:
      build in class FileAuditEndpoint.Builder
      Returns:
      the built audit endpoint.
      Throws:
      IOException - if an I/O error occurs.