4

This might be a too simple question for someone. How can I get a line break in my .log file by using Mage::log()? Whatever I pass to log() it treats as a string. Any help would be appreciated.

6

Just pass a Linux line break with double quotes

"\n"

Or if you are dumping an array, use a print method

print_r($array, true);
  • Thanks a lot. It worked perfectly. And +1 for the quick response. – Sukeshini Nov 5 '14 at 9:39
  • I tried \n but it does not work. – Black Jun 17 '18 at 13:54
4

Instead of "\n" you can just use

PHP_EOL

So you could type something like:

Mage::log(PHP_EOL.$your_message);

  • This should be the accepted answer! – Black Jun 17 '18 at 13:55

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.