From 6907049880f8b811d08ca586eac35c3e8a33e3f8 Mon Sep 17 00:00:00 2001 From: Pinga <121483313+getpinga@users.noreply.github.com> Date: Sat, 9 Dec 2023 01:05:08 +0200 Subject: [PATCH] Small component rename --- automation/{notifications.php => messagebroker.php} | 10 +++++++--- docs/install.md | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) rename automation/{notifications.php => messagebroker.php} (95%) diff --git a/automation/notifications.php b/automation/messagebroker.php similarity index 95% rename from automation/notifications.php rename to automation/messagebroker.php index 633be40..8e55df7 100644 --- a/automation/notifications.php +++ b/automation/messagebroker.php @@ -26,11 +26,14 @@ require_once 'helpers.php'; $server = new Server("127.0.0.1", 8250); $server->set([ 'daemonize' => false, - 'log_file' => '/var/log/namingo/notifications.log', + 'log_file' => '/var/log/namingo/messagebroker_application.log', 'log_level' => SWOOLE_LOG_INFO, 'worker_num' => swoole_cpu_num() * 2, - 'pid_file' => '/var/run/notifications.pid' + 'pid_file' => '/var/run/messagebroker.pid' ]); +$logFilePath = '/var/log/namingo/messagebroker.log'; +$log = setupLogger($logFilePath, 'Message_Broker'); +$log->info('job started.'); $server->on("request", function (Request $request, Response $response) use ($c) { // Parse the received data @@ -132,7 +135,8 @@ $server->on("request", function (Request $request, Response $response) use ($c) $response->end(json_encode(['status' => 'error', 'message' => 'Unknown action'])); return; } - + + $log->info('job finished successfully.'); $response->end(json_encode(['status' => 'success'])); }); diff --git a/docs/install.md b/docs/install.md index f067ae7..13a4d72 100644 --- a/docs/install.md +++ b/docs/install.md @@ -364,15 +364,15 @@ or composer require phpmailer/phpmailer ``` -This command will install one of the packages which are essential for the notification script to function correctly. +This command will install one of the packages which are essential for the message broker script to function correctly. ### Configuring the Crontab for Automation Scripts To set up automated tasks for Namingo, open the example crontab file located at ```/opt/registry/automation/crontab.example```. Review the contents and copy the relevant lines into your system's crontab file. Remember to adjust the paths and timings as necessary to suit your environment. -### Running the `notifications.php` Script in the Background +### Running the `messagebroker.php` Script in the Background -To run the notifications.php script as a background process, execute the following command: ```/usr/bin/php /opt/registry/automation/notifications.php &```. This will start the script and place it in the background, allowing it to run independently of your current terminal session. +To run the messagebroker.php script as a background process, execute the following command: ```/usr/bin/php /opt/registry/automation/messagebroker.php &```. This will start the script and place it in the background, allowing it to run independently of your current terminal session. ### Setting Up an Audit Trail Database for Namingo