Log files are a set of records located in /var/log in Linux servers which help the administrators to keep track of important events. They contain messages about the server, including the kernel, services, audit, and applications running on it. The log file can grow rapidly based on the application you are using and which may consume more space.
Use of logrotate
Log rotate is the process for archiving the old log daily/weekly/monthly based on your requirement. It also renames the logs file and compresses the files and delete the old logs which help to reduce the disk space in the server. Archiving the log files daily/weekly/monthly helps administrators to review the log easily for audit and troubleshooting purpose.
# yum update && yum install logrotate
Lets configure logrotate for the apache2
weekly # rotates the log on weekly basis
rotate 10 # only ten logfiles will be kepy and older will be deleted
size 10M # logs will not be rotated until the log file size reaches 10MB
compress # compress the only log files except the current log file