Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix(parser): Add logging support for applications in services

Leonid Zharikovc4ef08d4194a
diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php
index a020e75582..14f059d13f 100644
--- a/bootstrap/helpers/shared.php
+++ b/bootstrap/helpers/shared.php
@@ -3175,6 +3175,13 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
}
}
+ $serviceAppsLogDrainEnabledMap = collect([]);
+ if ($resource instanceof Service) {
+ $serviceAppsLogDrainEnabledMap = $resource->applications()->get()->keyBy('name')->map(function ($app) {
+ return $app->isLogDrainEnabled();
+ });
+ }
+
// Parse the rest of the services
foreach ($services as $serviceName => $service) {
$image = data_get_str($service, 'image');
@@ -3185,6 +3192,9 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
if ($resource instanceof Application && $resource->isLogDrainEnabled()) {
$logging = generate_fluentd_configuration();
}
+ if ($resource instanceof Service && $serviceAppsLogDrainEnabledMap->get($serviceName)) {
+ $logging = generate_fluentd_configuration();
+ }
}
$volumes = collect(data_get($service, 'volumes', []));
$networks = collect(data_get($service, 'networks', []));