diff --git a/app/Actions/Database/StartMariadb.php b/app/Actions/Database/StartMariadb.php index d42b53c09..3e32c2481 100644 --- a/app/Actions/Database/StartMariadb.php +++ b/app/Actions/Database/StartMariadb.php @@ -69,6 +69,16 @@ class StartMariadb ] ] ]; + if ($this->database->destination->server->isDrainLogActivated()) { + $docker_compose['services'][$container_name]['logging'] = [ + 'driver' => 'fluentd', + 'options' => [ + 'fluentd-address' => "tcp://127.0.0.1:24224", + 'fluentd-async' => "true", + 'fluentd-sub-second-precision' => "true", + ] + ]; + } if (count($this->database->ports_mappings_array) > 0) { $docker_compose['services'][$container_name]['ports'] = $this->database->ports_mappings_array; } diff --git a/app/Actions/Database/StartMongodb.php b/app/Actions/Database/StartMongodb.php index c1f1b71df..4ebbb9ec4 100644 --- a/app/Actions/Database/StartMongodb.php +++ b/app/Actions/Database/StartMongodb.php @@ -76,6 +76,16 @@ class StartMongodb ] ] ]; + if ($this->database->destination->server->isDrainLogActivated()) { + $docker_compose['services'][$container_name]['logging'] = [ + 'driver' => 'fluentd', + 'options' => [ + 'fluentd-address' => "tcp://127.0.0.1:24224", + 'fluentd-async' => "true", + 'fluentd-sub-second-precision' => "true", + ] + ]; + } if (count($this->database->ports_mappings_array) > 0) { $docker_compose['services'][$container_name]['ports'] = $this->database->ports_mappings_array; } diff --git a/app/Actions/Database/StartMysql.php b/app/Actions/Database/StartMysql.php index 4cf4282b6..c3f04dc9f 100644 --- a/app/Actions/Database/StartMysql.php +++ b/app/Actions/Database/StartMysql.php @@ -69,6 +69,16 @@ class StartMysql ] ] ]; + if ($this->database->destination->server->isDrainLogActivated()) { + $docker_compose['services'][$container_name]['logging'] = [ + 'driver' => 'fluentd', + 'options' => [ + 'fluentd-address' => "tcp://127.0.0.1:24224", + 'fluentd-async' => "true", + 'fluentd-sub-second-precision' => "true", + ] + ]; + } if (count($this->database->ports_mappings_array) > 0) { $docker_compose['services'][$container_name]['ports'] = $this->database->ports_mappings_array; } diff --git a/app/Actions/Database/StartPostgresql.php b/app/Actions/Database/StartPostgresql.php index 6eefd45ff..1acdcf957 100644 --- a/app/Actions/Database/StartPostgresql.php +++ b/app/Actions/Database/StartPostgresql.php @@ -79,6 +79,16 @@ class StartPostgresql ] ] ]; + if ($this->database->destination->server->isDrainLogActivated()) { + $docker_compose['services'][$container_name]['logging'] = [ + 'driver' => 'fluentd', + 'options' => [ + 'fluentd-address' => "tcp://127.0.0.1:24224", + 'fluentd-async' => "true", + 'fluentd-sub-second-precision' => "true", + ] + ]; + } if (count($this->database->ports_mappings_array) > 0) { $docker_compose['services'][$container_name]['ports'] = $this->database->ports_mappings_array; } diff --git a/app/Actions/Database/StartRedis.php b/app/Actions/Database/StartRedis.php index a585678b3..0cbd01f63 100644 --- a/app/Actions/Database/StartRedis.php +++ b/app/Actions/Database/StartRedis.php @@ -78,6 +78,16 @@ class StartRedis ] ] ]; + if ($this->database->destination->server->isDrainLogActivated()) { + $docker_compose['services'][$container_name]['logging'] = [ + 'driver' => 'fluentd', + 'options' => [ + 'fluentd-address' => "tcp://127.0.0.1:24224", + 'fluentd-async' => "true", + 'fluentd-sub-second-precision' => "true", + ] + ]; + } if (count($this->database->ports_mappings_array) > 0) { $docker_compose['services'][$container_name]['ports'] = $this->database->ports_mappings_array; } diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 55dbefedd..25c6c879c 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -864,7 +864,6 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted ] ] ]; - ray($this->server->isDrainLogActivated()); if ($this->server->isDrainLogActivated()) { $docker_compose['services'][$this->container_name]['logging'] = [ 'driver' => 'fluentd', diff --git a/app/Models/Service.php b/app/Models/Service.php index 320d53ded..76c88eb85 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -797,6 +797,16 @@ class Service extends BaseModel $serviceLabels = $serviceLabels->merge(fqdnLabelsForTraefik($this->uuid, $fqdns, true)); } } + if ($this->server->isDrainLogActivated()) { + data_set($service, 'logging', [ + 'driver' => 'fluentd', + 'options' => [ + 'fluentd-address' => "tcp://127.0.0.1:24224", + 'fluentd-async' => "true", + 'fluentd-sub-second-precision' => "true", + ] + ]); + } data_set($service, 'labels', $serviceLabels->toArray()); data_forget($service, 'is_database'); data_set($service, 'restart', RESTART_MODE);