From 1c5892175933268ce99b2bbdbc6745da227839d4 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 10 Feb 2020 17:44:57 +0100 Subject: [PATCH] Improve the email notification for logged errors Closes #3157 --- .../lib/system/cronjob/ExceptionMailerCronjob.class.php | 4 ++-- wcfsetup/install/lang/de.xml | 8 ++++---- wcfsetup/install/lang/en.xml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/wcfsetup/install/files/lib/system/cronjob/ExceptionMailerCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/ExceptionMailerCronjob.class.php index d5f502a0c8..947f3273f2 100644 --- a/wcfsetup/install/files/lib/system/cronjob/ExceptionMailerCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/ExceptionMailerCronjob.class.php @@ -32,8 +32,8 @@ class ExceptionMailerCronjob extends AbstractCronjob { } $files[gmdate('Y-m-d', TIME_NOW)] = []; - $seen = []; foreach ($files as $file => $value) { + $seen = []; $path = WCF_DIR.'log/'.$file.'.txt'; if (!file_exists($path)) { unset($files[$file]); @@ -64,7 +64,7 @@ class ExceptionMailerCronjob extends AbstractCronjob { if ($exception['date'] < $timestamp) continue; $count++; - if (!isset($seen[$message]) && count($files[$file]['messages']) < 3) { + if (!isset($seen[$message]) && count($files[$file]['messages']) < 5) { $files[$file]['messages'][] = StringUtil::truncate(preg_replace('/\s+/', ' ', $message), 140); $seen[$message] = true; } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index a56b0f1a41..0227c094b7 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -636,9 +636,8 @@ die folgenden Fehlermeldungen auf Ihrer Website {@PAGE_TITLE|language} wurden seit dem {$date|plainTime} protokolliert: {foreach from=$files key=file item=data} -log/{$file}.txt {* this line ends with a space *} +log/{$file}.txt ({#$data[count]} Fehlermeldung{if $data[count] > 1}en{/if}) {* this line ends with a space *} ================== - {if $data[verdict]|isset} {if $data[verdict] == 'corrupt'} Das Fehlerprotokoll ist defekt. Bitte prüfen Sie das Protokoll händisch: {'WCF_DIR'|constant}log/{$file}.txt @@ -646,13 +645,14 @@ Das Fehlerprotokoll ist defekt. Bitte prüfen Sie das Protokoll händisch: {'WCF Das Fehlerprotokoll ist sehr groß. Bitte prüfen Sie das Protokoll händisch: {'WCF_DIR'|constant}log/{$file}.txt {/if} {else} -Das Fehlerprotokoll enthält {$data[count]} neue Einträge. Die ersten drei, in dieser E-Mail noch nicht genannten, Fehlermeldungen lauten: {foreach from=$data[messages] item=message} - {@$message} {* this line ends with a space *} {/foreach} {/if} {* this line is intentionally left empty *} -{/foreach}]]> +{/foreach} + +ACHTUNG: Die oben genannten Meldungen sind stark gekürzt. Sie können Details zu einzelnen Fehlermeldungen in der Administrationsoberfläche unter „Protokoll » Fehler“ einsehen.]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 54622a01fc..ba9f63ba92 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -612,9 +612,8 @@ the following errors have been logged on your website {@PAGE_TITLE|language} since {$date|plainTime}: {foreach from=$files key=file item=data} -log/{$file}.txt {* this line ends with a space *} +log/{$file}.txt ({#$data[count]} error{if $data[count] > 1}s{/if}) {* this line ends with a space *} ================== - {if $data[verdict]|isset} {if $data[verdict] == 'corrupt'} This protocol file is corrupted. Please check the protocol manually: {'WCF_DIR'|constant}log/{$file}.txt @@ -622,13 +621,14 @@ This protocol file is corrupted. Please check the protocol manually: {'WCF_DIR'| This protocol file is very large. Please check the protocol manually: {'WCF_DIR'|constant}log/{$file}.txt {/if} {else} -This protocol file contains {$data[count]} new entries. The first three error messages that are not yet listed in this email are: {foreach from=$data[messages] item=message} - {@$message} {* this line ends with a space *} {/foreach} {/if} {* this line is intentionally left empty *} -{/foreach}]]> +{/foreach} + +ATTENTION: The messages listed above are greatly shortened. You can view details of individual error messages in the administration interface under “Logs » Errors”.]]> -- 2.20.1