Exception.log and System.log under /var/log folder in Magento are over 2gb each.
Is it safe to clean them? If yes, what is the proper way of cleaning such logs?
Really appreciate all suggestions!
Exception.log and System.log under /var/log folder in Magento are over 2gb each.
Is it safe to clean them? If yes, what is the proper way of cleaning such logs?
Really appreciate all suggestions!
For the log files in var/log, it is safe to rotate them, zip them, delete them, truncate them, etc...
Best practices would say you should rotate them out on a periodic basis, zip them, and retain for xx days for review /analysis if it's needed.
On Linux based servers, using a program such as logrotate is a common set up for log rotation. The file /etc/logrotate.conf can be appended with log rotation for Magento log files:
/home/*/www/var/log/*log {
rotate 14
daily
compress
}
This would keep 14 days of logs, compressed daily.
System > Configuration > Advanced > System > Log Cleaning
EDIT:
You can disable the creation of these files in System > Configuration in the 'Developer' section (inside the Advanced group). Then go to the 'Log Settings' accordion. There will be an option to disable both system.log and exception.log.
Since you can disable their creation, I don't see why deleting them would cause any problems.