|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2019-02-25 20:17 UTC] valentiny510 at gmail dot com
 Description: ------------ When you try to inlude a non existent file, in the log appear two similar entries. [date] PHP Warning: require(non_existent_file): failed to open stream: No such file or directory in .../index.php on line 5 [date] PHP Fatal error: require(): Failed opening required 'non_existent_file' (include_path='...') in .../index.php on line 5 They are not exactly the same, so technically is a not a duplicate, but, they point to the same error, is kinda redundant IMHO, and also a bit confusing for the different error types, is just a Warning or Fatal error ? Is clear that one error is because the 'stream' to be parsed is empty or non existent and the other is an error because of the language construct 'require' does not have a valid file to include... Is not a bug, of course, that's why I am asking as a feature request to remove one of them, and let just one simpler entry, Ex: 'PHP Warning: file "xxx" not found, in file .../index.php, line 5' Let only the Warning for instance since the included file may not be so important for the entire framework execution to be Fatal... And if possible, PLEASE let us REMOVE THE TIMEZONE from the date of the logs... preferably have a 'log_format = %H.%i.%s' in the php.ini settings [..... Europe/IrrelevantCity] (Of course I know that we can have a custom error log system implemented, but...) Also would be nice (for security reasons) to have the option to NOT LOG the full paths, and log only the path/files.php relative to the root Thank you PatchesPull Requests
Pull requests: HistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 01:00:01 2025 UTC | 
That is awesome ! Thank you The logs (generally) are meant for the developers, and they should already know on that Continent/City is located the server (or servers), is kinda silly to have the logs full of useless information that only make the logs larger in size. For instance the largest identifiers are 30 bytes long (America/Argentina/Buenos_Aires)... a simple log with 1.000.000 lines is increased by 28+ MB only with that useless repetition, I know it doesn't seems too much and some can argue that the rotate logs will use compression, etc, but... And if we are talking about logs... I whould like to see another feature implemented... (again, I know we can implement custom error logs) and is, having the ability to log in a specified file format, json, csv, etc... similar to error_log(sprintf('["%s","%s",%d,...]%s', date, ip, port, ..., PHP_EOL)) Using json/array format is easier to search within the logs specific dates, ips, etc, with a simple isset(line[ x ]), in_array(ip), array_search(date), whatever... and as bonus, for error_log, whould be nice to autocreate the path/file.log if does not exists. Thank you, and thank you again Beberlei for the pull request