Skip to content

Commit

Permalink
chore: added debugging to database backup process
Browse files Browse the repository at this point in the history
  • Loading branch information
lewislarsen committed Jun 25, 2024
1 parent 860c544 commit dbef2e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/Services/Backup/Backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@ protected function dumpRemoteDatabase(
throw new DatabaseDumpException('Unsupported database type.');
}

$this->logDebug('Database dump command.', ['command' => $dumpCommand]);

$output = $sftp->exec($dumpCommand);
$this->logDebug('Database dump command output.', ['output' => $output]);

Expand All @@ -454,6 +456,9 @@ protected function dumpRemoteDatabase(
throw new DatabaseDumpException('Database dump file was not created or is empty.');
}

$fileContent = $sftp->exec('cat ' . escapeshellarg($remoteDumpPath));
$this->logDebug('Database dump file content snippet.', ['content' => substr($fileContent, 0, 500)]);

$this->logInfo('Database dump completed successfully.', ['remote_dump_path' => $remoteDumpPath]);
}

Expand Down

0 comments on commit dbef2e2

Please sign in to comment.