PHP error_log outputting line breaks as literal "\n" strings on Mac OSX

Apparently, this issue is independent of your operating system. See this question: PHP error log and newline chars

...you should be able to change the error_log directive in your php.ini on Debian to point to a file. If this is undefined, it will go through syslog which doesn't support multiple lines.


As an alternative, you can process / replace the '\n' via sed, so they display like new lines in the console:

Linux

$ tail -f error_log | sed "s/\\\n/\\n/g"

Mac OS X

# WARNING - don't just copy+paste (see comment below)
$ tail -f error_log | sed "s/\\\n/^M^L/g"

Note: In Mac OS X, the end of a line is CRLF (Carriage Return Line Feed) when in LINUX system it's only LF (Line Feed)

Note 2: In Mac OS X to output ^M in the Terminal, press Control+V Control+M, to output ^L, press Control+V Control+L