Package org.wildfly.security.audit
Class SizeRotatingFileAuditEndpoint.Builder
java.lang.Object
org.wildfly.security.audit.FileAuditEndpoint.Builder
org.wildfly.security.audit.SizeRotatingFileAuditEndpoint.Builder
- Enclosing class:
- SizeRotatingFileAuditEndpoint
A builder for size rotating file audit endpoints.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Construct a new instance.setMaxBackupIndex(int maxBackupIndex) Set the maximum number of files to backup.setRotateOnBoot(boolean rotateOnBoot) Set to a value oftrueif the file should be rotated before the a new file is set.setRotateSize(long rotateSize) Set the log file size the file should rotate at.Sets the suffix to be appended to the file name during the file rotation.setTimeZone(ZoneId timeZone) Set the configured time zone for this handler.Methods inherited from class org.wildfly.security.audit.FileAuditEndpoint.Builder
setCharset, setDateTimeFormatterSupplier, setFlushOnAccept, setLocation, setSyncOnAccept
-
Method Details
-
setRotateSize
Set the log file size the file should rotate at.- Parameters:
rotateSize- the size the file should rotate at- Returns:
- this builder.
-
setSuffix
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 theDateTimeFormatter. Note: Files will be rotated for the same suffix until reach the maximum backup index configured bysetMaxBackupIndex(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
Set the maximum number of files to backup.- Parameters:
maxBackupIndex- the maximum number of files to backup- Returns:
- this builder.
-
setRotateOnBoot
Set to a value oftrueif 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 alengthgreater than 0.- Parameters:
rotateOnBoot-trueto rotate on boot, otherwisefalse- Returns:
- this builder.
-
setTimeZone
Set the configured time zone for this handler.- Parameters:
timeZone- the configured time zone- Returns:
- this builder.
-
build
Construct a new instance.- Overrides:
buildin classFileAuditEndpoint.Builder- Returns:
- the built audit endpoint.
- Throws:
IOException- if an I/O error occurs.
-