public static class FileBasedEventHandlerConfiguration.FileRotation extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_ROTATION_FILE_SUFFIX
The default file rotation suffix format.
|
static long |
NO_MAX_FILE_SIZE
The file size value to use when no maximum is set.
|
Constructor and Description |
---|
FileRotation() |
Modifier and Type | Method and Description |
---|---|
List<RotationPolicy> |
buildRotationPolicies()
Builds
RotationPolicy instances from configuration options. |
TimeStampFileNamingPolicy |
buildTimeStampFileNamingPolicy(File file)
Builds a
TimeStampFileNamingPolicy instance from configuration options. |
long |
getMaxFileSize()
Gets the maximum file size of an audit log file in bytes.
|
String |
getRotationFilePrefix()
Gets the prefix to add to a log file on rotation.
|
String |
getRotationFileSuffix()
Gets the suffix to add to a log file on rotation.
|
String |
getRotationInterval()
Gets the interval to trigger a file rotation.
|
List<String> |
getRotationTimes()
Gets a list of times at which file rotation should be triggered; times should be provided as Strings that can
be parsed by
Duration that each specify an offset from midnight. |
boolean |
isRotationEnabled()
Gets log rotation enabled state.
|
void |
setMaxFileSize(long maxFileSize)
Sets the maximum file size of an audit log file in bytes.
|
void |
setRotationEnabled(boolean rotationEnabled)
Sets log rotation enabled state.
|
void |
setRotationFilePrefix(String rotationFilePrefix)
Sets the prefix to add to a log file on rotation.
|
void |
setRotationFileSuffix(String rotationFileSuffix)
Sets the suffix to add to a log file on rotation.
|
void |
setRotationInterval(String rotationInterval)
Sets the interval to trigger a file rotation.
|
void |
setRotationTimes(List<String> rotationTimes)
Sets a list of times at which file rotation should be triggered; times should be provided as Strings that can
be parsed by
Duration that each specify an offset from midnight. |
public static final long NO_MAX_FILE_SIZE
public static final String DEFAULT_ROTATION_FILE_SUFFIX
public boolean isRotationEnabled()
public void setRotationEnabled(boolean rotationEnabled)
rotationEnabled
- True - Enabled log rotation.
False - Disables log rotation.public long getMaxFileSize()
public void setMaxFileSize(long maxFileSize)
maxFileSize
- The maximum file size in bytes.public String getRotationFilePrefix()
public void setRotationFilePrefix(String rotationFilePrefix)
rotationFilePrefix
- The prefix to add to the file.public String getRotationFileSuffix()
SimpleDateFormat
. The default suffix is
"-yyyy.MM.dd-HH.mm.ss.gz".public void setRotationFileSuffix(String rotationFileSuffix)
SimpleDateFormat
. The default suffix is
"-yyyy.MM.dd-HH.mm.ss.gz".rotationFileSuffix
- The suffix to add to the file.public String getRotationInterval()
Duration
.
Examples of valid durations are:
5 seconds 5 minutes 5 hours disabledA value of "zero" or "disabled" means that time based file rotation is disabled.
public void setRotationInterval(String rotationInterval)
Duration
.
Examples of valid durations are:
5 seconds 5 minutes 5 hours disabledA value of "zero" or "disabled" disables time based file rotation.
rotationInterval
- A String that can be parsed as a Duration
, specifying rotation interval.public List<String> getRotationTimes()
Duration
that each specify an offset from midnight.
For example the list of [10 milliseconds, 20 milliseconds, 30 milliseconds] will
cause a file rotation to happen 10 milliseconds, 20 milliseconds and 30 milliseconds after midnight.public void setRotationTimes(List<String> rotationTimes)
Duration
that each specify an offset from midnight.
For example the list of [10 milliseconds, 20 milliseconds, 30 milliseconds] will
cause a file rotation to happen 10 milliseconds, 20 milliseconds and 30 milliseconds after midnight.rotationTimes
- The list of durations after midnight that rotation should happen.public TimeStampFileNamingPolicy buildTimeStampFileNamingPolicy(File file)
TimeStampFileNamingPolicy
instance from configuration options.file
- Initial log fileTimeStampFileNamingPolicy
instancepublic List<RotationPolicy> buildRotationPolicies()
RotationPolicy
instances from configuration options.RotationPolicy
instancesCopyright © 2025 Open Identity Platform Community. All rights reserved.