adt/error-logger

v3.1.3 2023-08-09 21:47 UTC

README

Sends more info about the error than Tracy\Logger. Moreover, it can send multiple errors not only the first.

Installation

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;
}