summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2018-04-10 18:01:54 +0200
committerUrban Müller2018-04-10 18:01:54 +0200
commit02cb32f0f1c216e5c3f7ed1a0038c1ae8a83f0a5 (patch)
tree66065107d00f92d28469f5edadefe0d462bcb062
parent6ad22e27660619e911a98f62a57e128214a40478 (diff)
downloaditools-02cb32f0f1c216e5c3f7ed1a0038c1ae8a83f0a5.tar.gz
itools-02cb32f0f1c216e5c3f7ed1a0038c1ae8a83f0a5.tar.bz2
itools-02cb32f0f1c216e5c3f7ed1a0038c1ae8a83f0a5.zip
provide host and time before body
-rw-r--r--it.class4
1 files 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";