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

@ -0,0 +1,12 @@
<?php
$c = require_once 'config.php';
require_once 'helpers.php';
$logFilePath = '/var/log/namingo/archive-logs.log';
$log = setupLogger($logFilePath, 'ARCHIVE_LOGS');
$log->info('job started.');
archiveOldLogs($logFilePath);
$log->info('job finished successfully.');