2

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 Jun 19 '18 at 14:00
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? – Akhil Kurian Aug 29 '16 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 – Raphael at Digital Pianism Aug 29 '16 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 ? – Akhil Kurian Aug 29 '16 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 – Raphael at Digital Pianism Aug 29 '16 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 Aug 29 '16 at 15:40
2

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 – George Irimiciuc Mar 14 at 9:33
2

In 1.9.4.1 (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.

Solution:

  • make sure "/var/log/" is writeable
  • create empty "/var/log/system.log" there
  • and/or wait when it will be fixed by Magento devs
New contributor
user2504763 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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