ID:               31955
 User updated by:  exaton at free dot fr
 Reported By:      exaton at free dot fr
 Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: WinXP Pro SP2
 PHP Version:      5CVS-2005-02-13 (dev)
 New Comment:

Arg ! I know my php.ini directives but never linked this issue to
log_errors_max_len... because it sounds like (and is described as, in
comments) the maximum length of an error message as reproduced in an
errorlog...

'twould be logical to trim the length of error messages in a log so as
to avoid file bloat, without necessarily limiting the length of error
output on a page... Hence my being misled.

Perhaps todo make the php.ini comment for this directive slightly more
explicit ?

Thanks a lot for pointing this out, anyway.


Previous Comments:
------------------------------------------------------------------------

[2005-02-22 11:05:28] [EMAIL PROTECTED]

No, *all* error messages are limited to the value of
log_errors_max_len.
For example, this code:
<?php
trigger_error(str_repeat("long string ", 10000), E_USER_ERROR);
?>
will not output "long string" 10000 times, the message you'll see will
be truncated too.

Also, please note that messages are truncated only during the output,
you still can get the original error message with call to
$exception->getMessage() method.

So, you have to change log_errors_max_len option in your php.ini if you
want to see full error messages that are longer than 1024 bytes (that's
default value).
That's expected behaviour.

------------------------------------------------------------------------

[2005-02-13 17:20:52] exaton at free dot fr

Description:
------------
[With PHP 5.0.4-dev Feb 13 2005 10:15:43 running on Apache 2.0.52 in
Windows XP SP2]

It appears that Exceptions have some sort of limit on the length of
their messages. When the message is too long, the throwing info is
simply truncated, leaving only the "in <file> on line <line>" intact at
the end.

Upon causing an Exception thus (sorry for the length, but it's the
whole point) :

throw new
Exception('012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567!
8');

one will notice the truncature described. Adding more figures to the
message will not change the incorrect output (truncature occurs at the
same length). Shortening that message, on the other hand, will
progressively "reveal" the rest of the throwing info.
(N.B. : because of HTML whitespace this is not evident until the
message is shortened by at least 4 or 5 bytes).

In this instance, the limit is of 979 bytes in the message, for a total
of 1127 bytes of HTML-decorated throwing info. These figures vary
however, total throwing info 1161 bytes long, eg., having also been
encountered, in another situation.

Said situation is a complex cause-exceptions handling part of my
company's web development kit (much to long and involuted to present as
reproduce code). Just saying that to explain how I came across such an
error : the throwing info of cause exceptions, nested to arbitrary
depth, can produce a very long message for the top Exception thrown.

Thank you for your time in solving this.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=31955&edit=1

Reply via email to