summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
Diffstat (limited to 'it.class')
-rw-r--r--it.class7
1 files changed, 7 insertions, 0 deletions
diff --git a/it.class b/it.class
index f5a8978..17f5658 100644
--- a/it.class
+++ b/it.class
@@ -194,6 +194,13 @@ function error($p = array(), $body = null, $to = null) # $body and $to deprecate
if ($toscreen || $sendmail)
{
$trace = it_debug::backtrace($p['backtraceskip']); # moved in here for performance in mass error case
+
+ if (strlen($p['body']) > 500000)
+ {
+ file_put_contents($datafn = "/tmp/alertdata/error-" . substr(md5($p['body']), 0, 2), $p['body']);
+ $p['body'] = "Body: " . getenv('HOSTNAME') . ":$datafn";
+ }
+
$body = ($p['body'] ? trim($p['body'])."\n\n" : "") . ($url && !$toscreen? "{$p['title']}\n\nUrl: $url\n\n" : "") . ($trace ? ($sendmail?"" :" ")."Trace: $trace\n\n" : "");
if ($sendmail) # we're mailing: send maximum info