Req #77667 [Opn]: Duplicate error log entries
| From: | beberlei@php.net | Date: | Thu, 28 Feb 2019 20:54:12 +0000 |
| Subject: | Req #77667 [Opn]: Duplicate error log entries | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219776@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77667&edit=1
ID: 77667
Updated by: beberlei@php.net
Reported by: valentiny510 at gmail dot com
Summary: Duplicate error log entries
Status: Open
Type: Feature/Change Request
Package: *General Issues
Operating System: Irrelevant
PHP Version: 7.2.15
Block user comment: N
Private report: N
New Comment:
These are not duplicate errors, but as you mentioned the warning leads to the follow up fatal error.
The reason why it stops here is you are using require(), whose stated feature contrary to include()
is exactly stopping the execution if the file cannot be loaded/executed. So everything here is
working as expected. With include you get a second warning and execution continues.
Since include/require both allow stream wrappers, it is important to have both error messages,
because the different systems need to be able to report the problems they have.
Previous Comments:
------------------------------------------------------------------------
[2019-02-25 20:17:22] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77667&edit=1