PingDirectory

Configure log retention and log rotation policies

PingDirectory servers enable configuring log rotation and log retention policies.

Log retention

When any retention limit is reached, the server removes the oldest archived log before creating a new log. Log retention is only effective if a log rotation policy is in place.

A new log publisher must have at least one log retention policy configured. The following policies are available:

File Count Retention policy

Sets the number of log files for the server to retain. The default file count is 10 logs. If the file count is set to 1, the log will continue 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.

Custom Retention policy

Create a new retention policy that meets the server’s requirements. This will require 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.

Log rotation

When a rotation limit is reached, the server rotates the current log and starts a new log. A new log publisher must have at least one log rotation policy configured. The following policies are available:

Time Limit Rotation policy

Rotates the log based on the length of time since the last rotation. Default implementations are provided for rotation every 24 hours and every seven days.

Fixed Time Rotation policy

Rotates the logs every day at a specified time (based on 24-hour). The default time is 2359.

Size Limit Rotation policy

Rotates the logs when the file reaches the maximum size. The default size limit is 100 MB.

Never Rotate policy

Used in a rare event that does not require log rotation.

Configure the log rotation policy

Use dsconfig to modify the log rotation policy for the access logger:

$ bin/dsconfig set-log-publisher-prop \
  --publisher-name "File-Based Access Logger" \
  --remove "rotation-policy:24 Hours Time Limit Rotation Policy" \
  --add "rotation-policy:7 Days Time Limit Rotation Policy"

Configure the log retention policy

Use dsconfig to modify the log retention policy for the access logger:

$ bin/dsconfig set-log-publisher-prop \
  --publisher-name "File-Based Access Logger" \
  --set "retention-policy:Free Disk Space Retention Policy"