Sends more info about the error than Tracy\Logger. Moreover, it can send multiple errors not only the first.
composer require adt/error-logger
Place this to your bootstrap.php after calling $configurator->enableDebugger()
:
$logger = \ADT\ErrorLogger::install(
$email = 'errors@example.com',
$maxEmailsPerDay = 100,
$maxEmailsPerRequest = 10,
$includeExceptionFile = true,
$errorMessageSanitizeRegex = '~\d|(/[^\s]*)|(\w+://)~', // removes all numbers, absolut paths and protocols
$emailSnooze = '1 day'
);
if (!\Tracy\Debugger::$productionMode) {
// Do not send emails
$logger->mailer = null;
}