Package org.opends.server.loggers
Interface RotationPolicy<T extends LogRotationPolicyCfg>
- Type Parameters:
T
- The type of rotation policy configuration handled by this retention policy implementation.
- All Known Implementing Classes:
FixedTimeRotationPolicy
,SizeBasedRotationPolicy
,TimeLimitRotationPolicy
public interface RotationPolicy<T extends LogRotationPolicyCfg>
This interface describes the rotation policy that should be used for the logger. Supported policies include size
based and time based.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
initializeLogRotationPolicy
(T config) Initializes this log rotation policy based on the information in the provided rotation policy configuration.boolean
rotateFile
(RotatableLogFile writer) This method indicates if the log file should be rotated or not.
-
Method Details
-
initializeLogRotationPolicy
Initializes this log rotation policy based on the information in the provided rotation policy configuration.- Parameters:
config
- The rotation policy configuration that contains the information to use to initialize this policy.- Throws:
ConfigException
- If an unrecoverable problem arises in the process of performing the initialization as a result of the server configuration.InitializationException
- If a problem occurs during initialization that is not related to the server configuration.
-
rotateFile
This method indicates if the log file should be rotated or not.- Parameters:
writer
- the file writer to be checked.- Returns:
- true if the log file should be rotated, false otherwise.
-