From 2e1c213dd0804d6820bb8ba7705a598630032d9f Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Wed, 3 Apr 2024 15:42:16 +0200 Subject: indicate logfile for further errors --- it.class | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/it.class b/it.class index 0351b57..3678d1f 100644 --- a/it.class +++ b/it.class @@ -273,11 +273,13 @@ static function error($p = array(), $extra = null) @file_put_contents($datafn = "$home/tmp/error-" . substr(md5($p['body']), 0, 2), $p['body']); # NOPHPLINT $p['body'] = " See " . getenv('HOSTNAME') . ":$datafn"; } + $service = it::match('[^.]*', $GLOBALS['ULTRASITE']); $body = ($p['omitdebuginfo'] >= 2 ? "" : ($url && !$toscreen? "Title: {$p['title']}\nUrl: $url\n" : "") . ($traceline ? ($sendmail ? "" : " ") . "Trace: $traceline\n" : "")) . (!$sendmail || $p['omitdebuginfo'] >= 2 ? "" : "Host: " . getenv('HOSTNAME') . " at " . date("Y-m-d H:i:s") . (($t = time() - $_SERVER['REQUEST_TIME']) ? " (invoked {$t}s before)" : "") . " id $mailid\n") . # no it::date() due to time- debug param + ($sendmail && it::is_live() ? "Log: see $service/log/alertlog $mailid" : "") . ($sendmail ? $p['head'] : "") . ($p['id'] && !$toscreen ? "Filter: timewindow=" . $p['graceperiod'] . "-" . ($p['graceperiod'] + $p['timewindow']) . " (previous err: " . it::date('', $errstamp) . ")\n" : "") . (!$origp['blockmail'] || $p['omitdebuginfo'] || $toscreen ? "" : "Block-resend: " . $origp['blockmail'] . " seconds\n") . @@ -285,7 +287,7 @@ static function error($p = array(), $extra = null) if ($sendmail || EDC('verboseerrors')) # we're mailing: send maximum info { - $p['title'] = it::replace(['alert:|server:|^: "' => "", '(pw|passw|password\d*|secret)(=)[^&\s]*' => '$1$2*****'], it::match('[^.]*', $GLOBALS['ULTRASITE']) . ": " . $p['title']) . " (via " . getenv('HOSTNAME') . ")"; + $p['title'] = it::replace(['alert:|server:|^: "' => "", '(pw|passw|password\d*|secret)(=)[^&\s]*' => '$1$2*****'], "$service: " . $p['title']) . " (via " . getenv('HOSTNAME') . ")"; if (!$p['omitdebuginfo']) { -- cgit v1.2.3