php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #39492 log_errors do not use error_append_string directive
Submitted: 2006-11-13 09:31 UTC Modified: 2021-11-23 12:19 UTC
Votes:16
Avg. Score:4.1 ± 0.9
Reproduced:14 of 14 (100.0%)
Same Version:7 (50.0%)
Same OS:6 (42.9%)
From: frederic dot linot at free dot fr Assigned:
Status: Closed Package: PHP options/info functions
PHP Version: 5.* OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: frederic dot linot at free dot fr
New email:
PHP Version: OS:

 

 [2006-11-13 09:31 UTC] frederic dot linot at free dot fr
Description:
------------
error_append_string directive not used when error is logged in a file.
Just used when error is displayed on screen.

Reproduce code:
---------------
error_reporting(E_ALL) ; 
ini_set('error_log', 'errors.txt') ;
ini_set('html_errors', false) ;
ini_set('error_append_string', " -- ".$_SERVER['REQUEST_URI']) ;
ini_set('log_errors', true) ;
ini_set('display_errors', true) ;

Expected result:
----------------
in errors.txt file :
Notice: Show me the error_append_string please ! in /home/fred/www/EasyZik-2006-10-29/test.php on line 9 -- /test.php

on screen :
Notice: Show me the error_append_string please ! in /home/fred/www/EasyZik-2006-10-29/test.php on line 9 -- /test.php

Actual result:
--------------
in errors.txt file :
Notice: Show me the error_append_string please ! in /home/fred/www/EasyZik-2006-10-29/test.php on line 9

on screen :
Notice: Show me the error_append_string please ! in /home/fred/www/EasyZik-2006-10-29/test.php on line 9 -- /test.php

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-13 09:34 UTC] frederic dot linot at free dot fr
Reproduce code was not complete, sorry.. (last line was omitted)
Here is :

error_reporting(E_ALL) ; 
ini_set('error_log', 'errors.txt') ;
ini_set('html_errors', false) ;
ini_set('error_append_string', " -- ".$_SERVER['REQUEST_URI']) ;
ini_set('log_errors', true) ;
ini_set('display_errors', true) ;
trigger_error("Show me the error_append_string please !") ;
 [2009-08-17 07:54 UTC] brad dot mcnay at webarena dot com dot au
I am also having this problem. The error_prepend_string shows when the 
error is displayed, but not in the log file. Any word on when this 
feature will be available?
 [2011-04-08 18:18 UTC] jani@php.net
-Package: Feature/Change Request +Package: PHP options/info functions -Operating System: mandriva 2006 +Operating System: * -PHP Version: 5.2.0 +PHP Version: 5.*
 [2021-11-23 12:19 UTC] cmb@php.net
-Status: Open +Status: Verified -Type: Feature/Change Request +Type: Documentation Problem
 [2021-11-23 12:19 UTC] cmb@php.net
From looking at the implementation[1], error_prepend_string and
error_append_string are indeed only used when displaying the
string on the screen.  From looking at the default php.ini
files[2], the reasoning becomes clear: these INI directives are
designed to be able to mark up the error message HTML, and as such
the implementation is deliberate.  This needs to be documented,
though.

Changing the behavior would require an RFC, so anybody who is
still looking for this is welcome to the pursue the RFC
process[3].

[1] <https://github.com/php/php-src/blob/php-7.4.26/main/main.c#L1390-L1419>
[2] <https://github.com/php/php-src/blob/php-7.4.26/php.ini-development#L570-L580>
[3] <https://wiki.php.net/rfc/howto>
 [2021-11-23 12:29 UTC] git@php.net
Automatic comment on behalf of cmb69
Revision: https://github.com/php/doc-en/commit/470a17d5e8fe468c2a74dacc8eecdc92784c02fb
Log: Fix #39492: log_errors do not use error_append_string directive
 [2021-11-23 12:29 UTC] git@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 06:01:30 2024 UTC