mirror of
https://github.com/getnamingo/registry.git
synced 2025-08-06 01:25:00 +02:00
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:
parent
2adce55a07
commit
4658913847
8 changed files with 14 additions and 211 deletions
12
automation/archive-logs.php
Normal file
12
automation/archive-logs.php
Normal 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.');
|
|
@ -57,6 +57,8 @@ $scheduler->php('/opt/registry/automation/domain-lifecycle-manager.php')->at('*/
|
|||
$scheduler->php('/opt/registry/automation/auto-approve-transfer.php')->at('*/30 * * * *');
|
||||
$scheduler->php('/opt/registry/automation/auto-clean-unused-contact-and-host.php')->at('5 0 * * *');
|
||||
|
||||
$scheduler->php('/opt/registry/automation/archive-logs.php')->at('0 1 1 * *');
|
||||
|
||||
// Conditional Cron Jobs
|
||||
if ($cronJobConfig['accounting']) {
|
||||
$scheduler->php('/opt/registry/automation/send-invoice.php')->at('1 0 1 * *');
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue