Log files are not writing in the log folder but previously they are writing in the folder. Any idea about this?.
5 Answers
There are several possible options here:
- Logs have been disabled under System > Configuration > Developer > Log Settings > Enabled
- Your server is full and thus can't write to the logs anymore.
- Maybe there's nothing to log (which is a good thing as that means there's no error/warning to log on your website)
- Maybe your
var/log
folder permissions have changed and thus Magento cannot write to this folder anymore.
-
-
@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 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 ? 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 Aug 29, 2016 at 15:16
-
2Permissions. Check if logging is not going to /tmp/magento/var/log ( off the top of my head, so could be incorrect path) Aug 29, 2016 at 15:40
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
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
withSELINUX=permissive
. Details here 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.