How to Manage Large Log Files?

When the system log file increase it means that there is some issue with associated software or programs. In that case simply check the newest activities in the log file.

For that sign in to your server and run the following command:

tail /var/log/logfile-name

If the problem is not experienced from the newest activities, you can go through the complete log data for hints:

less /var/log/logfile-name

Search for the repeated messages in the log file,Once the problem is encountered, fix it and clear the log  file and start with an new one. Ongoing the same large log file will consume much space. Run the following command:

logrotate -v -f /etc/logrotate.d/logname

The above command will archive the old log file, and creates a new empty log file for further use.