Configuring log retention
The server allows you to configure the log retention policy for each log on the server.
About this task
When a retention limit is reached, the server removes the oldest archived log before creating a new log. Log retention is only effective if you have a log rotation policy in place.
If you create a new log publisher, you must configure at least one log retention policy.
- File Count Retention Policy
-
Sets the number of log files you want the server to retain. The default file count is 10 logs. If the file count is set to 1, then the log continues to grow indefinitely without being rotated.
- Free Disk Space Retention Policy
-
Sets the minimum amount of free disk space. The default free disk space is 500 MB.
- Size Limit Retention Policy
-
Sets the maximum size of the combined archived logs. The default size limit is 500 MB.
- Time Limit Retention Policy
-
Sets the maximum length of time that rotated log files should be retained.
- Custom Retention Policy
-
Create a new retention policy that meets your server’s requirements. This requires developing custom code to implement the desired log retention policy.
- Never Delete Retention Policy
-
Used in a rare event that does not require log deletion.
Steps
-
Use
dsconfig
to modify the log retention policy for the access logger.Example:
$ bin/dsconfig set-log-publisher-prop \ --publisher-name "File-Based Access Logger" \ --set "retention-policy:Free Disk Space Retention Policy"