How to customize log rotation for auth.log in vCloud Director Releases 9.7.0.3 and 10.0
search cancel

How to customize log rotation for auth.log in vCloud Director Releases 9.7.0.3 and 10.0

book

Article ID: 328001

calendar_today

Updated On:

Products

VMware

Issue/Introduction

This document is to assist the service provider so they can adjust the log rotation settings for /var/log/auth.log and /var/log/messages to meet their own file retention policies.

The log rotation policy of the vCloud Director Appliance does not meet the requirements of the service provider file retention policy. Disk space may be running low or too many / too few auth or messages log files may be saved.

Resolution

Maintain a healthy amount of free disk space (30GB or more) by adjusting the minsize and rotate values located in the log rotation policy file /etc/logrotate.d/messages-and-auth. You may also have to increase the size of the root { / ) file system if you are holding more and larger files for a longer period of time.

  1. The default log rotation policy:

/var/log/messages {
minsize 10M
daily
rotate 10
compress
delaycompress
notifempty
}

/var/log/auth.log {
minsize 10M
daily
rotate 10
compress
delaycompress
notifempty
postrotate
/usr/bin/systemctl restart rsyslog.service
endscript
}

  1. Make changes to the following parameters: 

minsize <size>

Log files are rotated when they grow larger than the specified size but not before the specified time interval.

rotate <number>

 

Indicates how many times to rotate before deleting a file.

  1. After these changes are made they are permanent and are not overwritten by software updates. There is no need to restart a process because log rotation is a cron job.