Why are my Magento logs not rotating properly?

Fixing Magento Logs Not Rotating Issue

If you are facing the issue of Magento logs not rotating, it can lead to bloated log files that can affect the performance of your website. Here’s how you can solve this problem:

  1. Access your server via SSH or FTP.
  2. Navigate to the root directory of your Magento installation.
  3. Locate the log.php file in the app/code/core/Mage/Log/Model directory.
  4. Open the log.php file in a text editor.
  5. Find the following line of code:
  6.   protected $_logFile = 'system.log';
      
  7. Replace it with the following code:
  8.   protected $_logFile = 'system.log';
      protected $_logType = 3;
      
  9. Save the file and upload it back to the server.
  10. Clear the cache in Magento admin panel.
  11. Check if the logs are now rotating properly.

By following these steps, you should be able to resolve the issue of Magento logs not rotating efficiently. This will help in maintaining a clean and optimized log system for your Magento store.

Still need help?

Our expert team of developers, coders, and marketers are ready to solve your problem!
Just $88 covers consulting, discovery, and one hour of development or troubleshooting. Click here.

Back To Top
Theme Mode