Log files are not writing in the log folder but previously they are writing in the folder. Any idea about this?.

  • Is there a solution yet?
    – Black
    Commented Jun 19, 2018 at 14:00

5 Answers 5


There are several possible options here:

  1. Logs have been disabled under System > Configuration > Developer > Log Settings > Enabled
  2. Your server is full and thus can't write to the logs anymore.
  3. Maybe there's nothing to log (which is a good thing as that means there's no error/warning to log on your website)
  4. Maybe your var/log folder permissions have changed and thus Magento cannot write to this folder anymore.
  • Is any possibility of hacking to prevent log writing? Commented Aug 29, 2016 at 15:07
  • @AkhilKurian well I don't see why someone would prevent log writing to hack your website. There's no reason behind that. I've added an extra reason Commented Aug 29, 2016 at 15:08
  • PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)' in /var/www/html/bluemountainorganics/lib/Zend/Db/Adapter/Pdo/Abstract.php:129 I got this error in yesterday on cron is any idea aboutthis ? Commented Aug 29, 2016 at 15:12
  • @AkhilKurian well it has nothing to do with the logs. It means Magento couldn't connect to MySQL, there's several reasons: maybe the Database server was down, the credentials have changed or you're out of space in your server Commented Aug 29, 2016 at 15:16
  • 2
    Permissions. Check if logging is not going to /tmp/magento/var/log ( off the top of my head, so could be incorrect path)
    – ProxiBlue
    Commented Aug 29, 2016 at 15:40

In (or after applying SUPEE-11086 patch) if you delete "/var/log/system.log" log file becomes "not writeable" (even if directory is writeable), so Magento skips writing log.


  • make sure "/var/log/" is writeable
  • create empty "/var/log/system.log" there
  • and/or wait when it will be fixed by Magento devs

I've found that if SELinux is not set properly for Magento, nothing gets written to the Magento logs, but instead goes to the /tmp location. Try 'setenforce Permissive' to disable SELinux. If the logs begin to receive output, then SELinux was to blame. Unfortunately, I do not know how to allow the Magento user (on CentOS it's apache) to write to the log files. With SELinux, even setting permissions on that file to 777 doesn't help.

So, by disabling SELinux with 'setenforce Permissive', just remember that after a reboot, it will be enabled again.

  • This worked in my case, to keep it permanent edit /etc/sysconfig/selinux with SELINUX=permissive. Details here Commented Mar 14, 2019 at 9:33

@sv3n solution above worked for me.

Creating empty files in the var/log folder for system.log and exception.log allowed them to work again.

On v1.9.3.10.


Check under /tmp/magento

i.e. /tmp/magento/var/log

When magento has a problem writing to var/logs|cache|sessions, sometimes it writes to /tmp/magento/var/* instead, which is the default location.

Even once the original issue is fixed it often keeps writing them to /tmp/magento/var/log.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.