From b321abbe2ebdec11aff9aef2cee21f09da0005d4 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Wed, 3 Dec 2025 15:47:58 +0100 Subject: [PATCH] refactor: Remove unnecessary logging from various jobs and views --- app/Jobs/DatabaseBackupJob.php | 1 - app/Jobs/ValidateAndInstallServerJob.php | 24 ------------------- app/Notifications/Dto/PushoverMessage.php | 4 ---- bootstrap/helpers/shared.php | 13 ---------- .../project/new/coolify-json-import.blade.php | 2 +- .../project/shared/upload-config.blade.php | 2 +- 6 files changed, 2 insertions(+), 44 deletions(-) diff --git a/app/Jobs/DatabaseBackupJob.php b/app/Jobs/DatabaseBackupJob.php index a585baa69..4c566186c 100644 --- a/app/Jobs/DatabaseBackupJob.php +++ b/app/Jobs/DatabaseBackupJob.php @@ -472,7 +472,6 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue throw new \Exception('MongoDB credentials not found. Ensure MONGO_INITDB_ROOT_USERNAME and MONGO_INITDB_ROOT_PASSWORD environment variables are available in the container.'); } } - \Log::info('MongoDB backup URL configured', ['has_url' => filled($url), 'using_env_vars' => blank($this->database->internal_db_url)]); if ($databaseWithCollections === 'all') { $commands[] = 'mkdir -p '.$this->backup_dir; if (str($this->database->image)->startsWith('mongo:4')) { diff --git a/app/Jobs/ValidateAndInstallServerJob.php b/app/Jobs/ValidateAndInstallServerJob.php index b5e1929de..7daa0a712 100644 --- a/app/Jobs/ValidateAndInstallServerJob.php +++ b/app/Jobs/ValidateAndInstallServerJob.php @@ -35,12 +35,6 @@ class ValidateAndInstallServerJob implements ShouldQueue // Mark validation as in progress $this->server->update(['is_validating' => true]); - Log::info('ValidateAndInstallServer: Starting validation', [ - 'server_id' => $this->server->id, - 'server_name' => $this->server->name, - 'attempt' => $this->numberOfTries + 1, - ]); - // Validate connection ['uptime' => $uptime, 'error' => $error] = $this->server->validateConnection(); if (! $uptime) { @@ -92,13 +86,6 @@ class ValidateAndInstallServerJob implements ShouldQueue return; } - Log::info('ValidateAndInstallServer: Installing prerequisites', [ - 'server_id' => $this->server->id, - 'attempt' => $this->numberOfTries + 1, - 'missing_commands' => $validationResult['missing'], - 'found_commands' => $validationResult['found'], - ]); - // Install prerequisites $this->server->installPrerequisites(); @@ -128,11 +115,6 @@ class ValidateAndInstallServerJob implements ShouldQueue return; } - Log::info('ValidateAndInstallServer: Installing Docker', [ - 'server_id' => $this->server->id, - 'attempt' => $this->numberOfTries + 1, - ]); - // Install Docker $this->server->installDocker(); @@ -158,12 +140,6 @@ class ValidateAndInstallServerJob implements ShouldQueue return; } - // Validation successful! - Log::info('ValidateAndInstallServer: Validation successful', [ - 'server_id' => $this->server->id, - 'server_name' => $this->server->name, - ]); - // Start proxy if needed if (! $this->server->isBuildServer()) { $proxyShouldRun = CheckProxy::run($this->server, true); diff --git a/app/Notifications/Dto/PushoverMessage.php b/app/Notifications/Dto/PushoverMessage.php index abf6f1b7a..42f574029 100644 --- a/app/Notifications/Dto/PushoverMessage.php +++ b/app/Notifications/Dto/PushoverMessage.php @@ -2,8 +2,6 @@ namespace App\Notifications\Dto; -use Illuminate\Support\Facades\Log; - class PushoverMessage { public function __construct( @@ -43,8 +41,6 @@ class PushoverMessage $payload['message'] .= " ".$text.''; } - Log::info('Pushover message', $payload); - return $payload; } } diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index e81b151de..c06bcb0c4 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -2966,8 +2966,6 @@ function getHelperVersion(): string function loadConfigFromGit(string $repository, string $branch, string $base_directory, int $server_id, int $team_id): ?array { - Log::info("coolify.json: Starting detection for {$repository} branch {$branch} base_dir {$base_directory}"); - $server = Server::where('id', $server_id)->where('team_id', $team_id)->first(); if (! $server) { Log::warning("coolify.json: Server not found - server_id: {$server_id}, team_id: {$team_id}"); @@ -2986,8 +2984,6 @@ function loadConfigFromGit(string $repository, string $branch, string $base_dire } $pathsToCheck[] = 'coolify.json'; - Log::info('coolify.json: Checking paths - '.implode(', ', $pathsToCheck)); - // Build sparse-checkout file list $fileList = collect($pathsToCheck)->map(fn ($path) => "./{$path}")->implode(' '); @@ -3010,11 +3006,7 @@ function loadConfigFromGit(string $repository, string $branch, string $base_dire try { $output = instant_remote_process($commands, $server); - Log::info('coolify.json: Raw output length - '.strlen($output ?? '')); - if (empty($output)) { - Log::info('coolify.json: No output from remote process'); - return null; } @@ -3038,11 +3030,6 @@ function loadConfigFromGit(string $repository, string $branch, string $base_dire // Warn about unknown top-level fields $knownFields = ['version', 'name', 'description', 'build', 'domains', 'environment_variables', 'health_check', 'limits', 'settings']; $unknownFields = array_diff(array_keys($config), $knownFields); - if (! empty($unknownFields)) { - Log::info('coolify.json: Unknown fields detected (will be ignored) - '.implode(', ', $unknownFields)); - } - - Log::info('coolify.json: Successfully loaded config with keys - '.implode(', ', array_keys($config))); return $config; } catch (\Exception $e) { diff --git a/resources/views/livewire/project/new/coolify-json-import.blade.php b/resources/views/livewire/project/new/coolify-json-import.blade.php index 1911196b8..e937aa0c3 100644 --- a/resources/views/livewire/project/new/coolify-json-import.blade.php +++ b/resources/views/livewire/project/new/coolify-json-import.blade.php @@ -14,7 +14,7 @@
{{ $parseError }}
@endif -