Re: error_log function
| From: | Jaap van Ganswijk | Date: | Sun, 29 Jun 2003 10:11:30 +0000 |
| Subject: | Re: error_log function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-153311@lists.php.net to get a copy of this message | ||
At 2003-06-29 03:55 +0200, Ole Brumm wrote:
>I have just implemented the error_log function on my web site, as I find this
>feature very useful. I have chosen to write to a file on the server.
>
>my question is: How can I make error_log write each error message on a NEW line
>in the file I have chosen. Now, every message is written on a long line, which
>is not very user friendly. I have tried to put \n on the end of the message, but
>it didn`t have any effect.
When you want to be able to look at the log file
using some crummy Windows tool, make sure to
use "\r\n". Borland tools and Wordpad for
example can handle "\n"-only files, but IE
and Notepad not.
Also make sure you use double quotes and not
single quotes.
I'm using this under Unix and it works fine:
error_log(serialize($A)."\n",3,$log);
$log = the name of the file to log to
$A = is an array with data that I want to log
Greetings,
Jaap