Re: Length of Exception text?
| From: | Jochem Maas | Date: | Mon, 08 Sep 2008 17:33:16 +0000 |
| Subject: | Re: Length of Exception text? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-279678@lists.php.net to get a copy of this message | ||
ANR Daemon schreef:
Greetings, Jochem Maas. In reply to Your message dated Sunday, September 7, 2008, 20:56:37,are you printing to screen or to error_log (or syslog)? I believe error_log has a limit as to the length of the string that will actually be logged ... I can't remember whether this was php, apache or system related. I do remember writing the following function at one time to counter truncated messages: function syslog_multiline($priority, $message) {I've been working on some PEAR-based app last week and I ran into problem. While I debugging app, my backtrace always trimmed at some point. First time I though it was my mistake, and switched back to standard "Exception" class. But nothing changed. If I print everything by hands, it's all full and good, but if I let PHP printwhat do you mean by:1. print by handCatch excetion and manually call getTraceAsString.2. let PHP printDo not catch exception, let PHP behave on it's own way.
$r = false;
$chunks = str_split($message, 500);
foreach ($chunks as $chunk) {
$r &= syslog($priority, $chunk);
}
return $r;} yes, it's pretty crufty, but hey it worked.
exception message, it getting trimmed at 1015 characters, rendering backtrace almost useless. Say, only my own code producing 4-5 lines, PEAR stuff adding about 8, plus converting PEAR_Error to Exception at least 2 lines. All-in-all, up to 15 lines so far, and backtrace trimmed at 6'th or 7'th line. Is there any way to affect this behaviour without recompiling PHP?