This is what I say php:
<?php error_reporting(E_ALL); ini_set('display_errors', '0'); ini_set('log_errors', 1); ini_set('error_log', 'errors.log'); ini_set('error_append_string', 'APP'); ini_set('error_prepend_string', 'PRE'); ?>
We hope that I will receive all errors reported in one file, with the message "PRE" before the message and "APP" after the message. (My goal is to do PRE and APP in / n / r or something else ...)
But the error log looks like this:
[14-May-2013 00:16:26] PHP note: Undefined variable: nonexistentvariable in /home/www/dir/index.php on line 14 [May 14, 2013 00:16:28] PHP note: Undefined variable : nonexistentvariable in /home/www/dir/index.php on line 14
No PRE, No APP ...
How can I get it there so that in my error report file every error appears in a new line, and not in the error line that did not help me?
EDIT: So I noticed this with ini_set ('display_errors', '1'); the lines "APP" and "PRE" are displayed on the page in an error message.
This means that I really need to find out where I can change the format of how php logs errors. For example, all this timestamp - where is it indicated?
EDIT: It is not possible to change the php log errors method, you have to make your own error handler.
ANSWER: To really achieve what I was going to, I asked another question (more precisely). How to change the way php errors are written to the error log file?
olli source share