0

I have a cronjob for Magento 1.9 running to test some functions, so naturally I want to log the results of these functions, and make sure they're running. Initially, I had the line Mage::log('Running function'); and then another log line to write the variable. And this worked, but with all my testing, it was cluttering system.log so I decided to have it write all of this to a file called test.log instead. I changed that line to Mage::log('Running function', null, 'test.log'); but now no logs are being written. I even tried creating an empty test.log file manually but it isn't being populated. That is the only line I changed.* All my files have 777 permissions set and are owned by www-data (I am on Ubuntu). My logging is enabled (it was just logging to system.log so this is obvious). What could the issue be?

*Edit: I found that it wasn't the only line I changed. I had added a variable declaration (for a variable that wasn't even being used, so I didn't think it would affect my code) and I think magento didn't like that line. Shouldn't this have gone into a log file somewhere though?

0

Try to launch in your magento directory :

sudo find . -type f -exec chmod 400 {} \; && sudo find . -type d -exec chmod 500 {} \; && sudo find var/ -type f -exec chmod 600 {} \; && sudo find media/ -type f -exec chmod 600 {} \; && sudo find var/ -type d -exec chmod 700 {} \; && sudo find media/ -type d -exec chmod 700 {} \; && sudo chmod 700 includes && sudo chmod 600 includes/config.php

It will fix perm like Magento documentation.

  • No, I already have permissions at 777 for now, while I'm developing. I'm not going to change it to stricter rules. But I think I figured out the issue anyways, I had an extra line in there that shouldn't have been affecting any of my code, but magento didn't like it, so it was stopping there and never getting to the log lines. – ctrl-z pls Sep 4 '18 at 20:54
0

system.log : is used for all Php Warning, XML-file contains errors and warnings.

exception.log : is for all Exceptions when Magento not be able to detect the correct data then it log that in exception.log.

So log this two files and you custom log file. tail -f system.log exception.log test.log

  • There is no exception.log file. Why might that be? Because I found that I had added a line that magento didn't like, but it was failing silently and not logging anything, rather than logging that it hit an error. – ctrl-z pls Sep 5 '18 at 14:15
  • Go to Admin>system>Configuration>Developper>Log settings> then Enable the first field, Second : system.log, Third : exception.log. – PЯINCƏ Sep 5 '18 at 14:44
  • Thanks but it's already like that. I just double checked to make sure, but logging is enabled and system.log and exception.log are both in the other fields. And it's not permissions because the entire var folder (the entire magento directory actually) has 777 permission. – ctrl-z pls Sep 5 '18 at 14:52

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.