adt/error-logger

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

README

比Tracy\Logger更详细地发送错误信息。此外,它还可以发送多个错误,而不仅仅是第一个。

安装

composer require adt/error-logger

在调用 $configurator->enableDebugger() 后,将此代码放入您的bootstrap.php中

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