From 02cb32f0f1c216e5c3f7ed1a0038c1ae8a83f0a5 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 10 Apr 2018 18:01:54 +0200 Subject: provide host and time before body --- it.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/it.class b/it.class index ef2b0ce..2715438 100644 --- a/it.class +++ b/it.class @@ -249,6 +249,8 @@ static function error($p = array()) $body = ($p['omitdebuginfo'] >= 2 ? "" : ($url && !$toscreen? "{$p['title']}\n\nUrl: $url\n\n" : "") . ($trace ? ($sendmail ? "" : " ") . "Trace: $trace\n\n" : "")) . + "Host: " . getenv('HOSTNAME') . "\n\n" . + "Time: " . date("Y-m-d H:i:s") . (($t = time() - $_SERVER['REQUEST_TIME']) ? " (started {$t}s before)" : "") . "\n\n" . # no it::date() due to time- debug param ($p['body'] ? ($p['omitdebuginfo'] ? "" : "Body:\n") . trim($p['body'])."\n\n" : ""); if ($sendmail) # we're mailing: send maximum info @@ -261,8 +263,6 @@ static function error($p = array()) if ($level >= $p['backtraceskip'] && $tracesize < 100000 && ($tracesize += strlen(print_r($stackframe, true))) < 100000) # save mem $stackframes[] = $stackframe; - $body .= "Host: " . getenv('HOSTNAME') . "\n\n"; - $body .= "Time: " . date("Y-m-d H:i:s") . (($t = time() - $_SERVER['REQUEST_TIME']) ? " (started {$t}s before)" : "") . "\n\n"; # no it::date() due to time- debug param $body .= $p['id'] ? "Filter: timewindow=" . $p['graceperiod'] . "-" . ($p['graceperiod'] + $p['timewindow']) . " (previous err: " . it::date('', $errstamp) . ")\n\n" : ""; $body .= $origp['blockmail'] ? "Block-resend: " . $origp['blockmail'] . " seconds\n\n" : ""; $body .= !$trace ? "" : "Overview: ssh " . getenv('HOSTNAME') . " 'cat /tmp/alertdata/alertlog | grep \"$trace\"'\n\n"; -- cgit v1.2.3