Added ability to send emails on errors (change required)

Add MAIL_TO_ADDRESS in .env and make sure iana_email is configured.
This commit is contained in:
Pinga 2025-02-14 21:32:34 +02:00
parent 2adce55a07
commit 4658913847
8 changed files with 14 additions and 211 deletions

View file

@ -54,15 +54,6 @@ function setupLogger($logFilePath, $channelName = 'app') {
$fileHandler->setFormatter($fileFormatter);
$log->pushHandler($fileHandler);
// Archive logs older than 14 days
archiveOldLogs($logFilePath);
// Pushover Handler (For CRITICAL, ALERT, EMERGENCY)
if (!empty($config['pushover_key'])) {
$pushoverHandler = new PushoverHandler($config['pushover_key'], Logger::ALERT);
$log->pushHandler($pushoverHandler);
}
// Email Handler (For CRITICAL, ALERT, EMERGENCY)
if (!empty($config['mailer_smtp_host'])) {
// Create a PHPMailer instance