Class SizeRotatingFileAuditEndpoint.Builder

    • Field Detail

      • rotateSize

        private long rotateSize
      • maxBackupIndex

        private int maxBackupIndex
      • rotateOnBoot

        private boolean rotateOnBoot
      • suffix

        private String suffix
    • Constructor Detail

      • Builder

        Builder()
    • Method Detail

      • 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.