Skip to content

Commit f1a7f3f

Browse files
committed
Remove logging.
1 parent 0a62f53 commit f1a7f3f

File tree

9 files changed

+3
-73
lines changed

9 files changed

+3
-73
lines changed

app/Console/Commands/AppUpdateQueriesCommand.php

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ public function handle()
8484
*/
8585
protected function createS3Directories(): void
8686
{
87-
\Log::info('Creating S3 directories...');
88-
8987
$directories = [
9088
config('config.uploads.site-assets'),
9189
config('config.uploads.project-assets'),
@@ -95,25 +93,18 @@ protected function createS3Directories(): void
9593
try {
9694
if (! Storage::disk('s3')->exists($directory)) {
9795
Storage::disk('s3')->makeDirectory($directory);
98-
\Log::info("Created directory: {$directory}");
99-
} else {
100-
\Log::info("Directory already exists: {$directory}");
10196
}
10297
} catch (\Exception $e) {
10398
$this->error("Failed to create directory {$directory}: ".$e->getMessage());
10499
}
105100
}
106-
107-
\Log::info('S3 directory creation completed.');
108101
}
109102

110103
/**
111104
* Move files between S3 directories using AWS CLI for optimal performance
112105
*/
113106
protected function moveS3DirectoryFiles(): void
114107
{
115-
\Log::info('Moving S3 directory files...');
116-
117108
$bucket = config('filesystems.disks.s3.bucket');
118109
$region = config('filesystems.disks.s3.region');
119110

@@ -133,17 +124,13 @@ protected function moveS3DirectoryFiles(): void
133124
foreach ($migrations as $migration) {
134125
$this->migrateS3Directory($bucket, $region, $migration['from'], $migration['to'], $migration['name']);
135126
}
136-
137-
\Log::info('S3 directory file migration completed.');
138127
}
139128

140129
/**
141130
* Migrate files from one S3 directory to another using AWS CLI
142131
*/
143132
protected function migrateS3Directory(string $bucket, string $region, string $fromDir, string $toDir, string $description): void
144133
{
145-
\Log::info("Migrating {$description}: {$fromDir}{$toDir}");
146-
147134
// Check if source directory has files
148135
$listCommand = sprintf(
149136
'aws s3 ls s3://%s/%s/ --region %s --recursive',
@@ -157,13 +144,10 @@ protected function migrateS3Directory(string $bucket, string $region, string $fr
157144
exec($listCommand.' 2>/dev/null', $output, $returnCode);
158145

159146
if (empty($output)) {
160-
\Log::info(" No files found in source directory: {$fromDir}");
161-
162147
return;
163148
}
164149

165150
$fileCount = count($output);
166-
\Log::info(" Found {$fileCount} files to migrate");
167151

168152
// Get initial count of destination directory
169153
$destListCommand = sprintf(
@@ -180,9 +164,6 @@ protected function migrateS3Directory(string $bucket, string $region, string $fr
180164
$initialDestFileCount = count($destInitialOutput);
181165
$expectedFinalCount = $initialDestFileCount + $fileCount;
182166

183-
\Log::info(" Initial destination files: {$initialDestFileCount}");
184-
\Log::info(" Expected final count: {$expectedFinalCount}");
185-
186167
// Copy files to new directory
187168
$copyCommand = sprintf(
188169
'aws s3 cp s3://%s/%s/ s3://%s/%s/ --region %s --recursive',
@@ -193,7 +174,6 @@ protected function migrateS3Directory(string $bucket, string $region, string $fr
193174
escapeshellarg($region)
194175
);
195176

196-
\Log::info(' Copying files...');
197177
$copyOutput = [];
198178
$copyReturnCode = 0;
199179
exec($copyCommand.' 2>&1', $copyOutput, $copyReturnCode);
@@ -204,8 +184,6 @@ protected function migrateS3Directory(string $bucket, string $region, string $fr
204184
return;
205185
}
206186

207-
\Log::info(' Files copied successfully');
208-
209187
// Verify copy operation by listing destination directory
210188
$verifyOutput = [];
211189
$verifyReturnCode = 0;
@@ -218,20 +196,13 @@ protected function migrateS3Directory(string $bucket, string $region, string $fr
218196

219197
return;
220198
}
221-
222-
\Log::info(" Verification successful: {$actualFinalCount} files in destination");
223-
224-
\Log::info(" ✅ Migration completed: {$description}");
225-
\Log::info(" Original files preserved in: {$fromDir}");
226199
}
227200

228201
/**
229202
* Update database paths for moved files
230203
*/
231204
protected function updateDatabasePaths(): void
232205
{
233-
\Log::info('Updating database paths...');
234-
235206
// Update ProjectAsset paths from project-resources/downloads to project-assets
236207
$oldProjectPath = config('config.uploads.project_resources_downloads');
237208
$newProjectPath = config('config.uploads.project-assets');
@@ -241,19 +212,13 @@ protected function updateDatabasePaths(): void
241212
->get();
242213

243214
if ($projectAssetUpdates->isNotEmpty()) {
244-
\Log::info(" Updating {$projectAssetUpdates->count()} ProjectAsset records...");
245-
246215
foreach ($projectAssetUpdates as $asset) {
247216
$newPath = str_replace($oldProjectPath, $newProjectPath, $asset->download_path);
248217

249218
DB::table('project_assets')
250219
->where('id', $asset->id)
251220
->update(['download_path' => $newPath]);
252-
253-
\Log::info(" Updated ProjectAsset {$asset->id}: {$asset->download_path}{$newPath}");
254221
}
255-
} else {
256-
\Log::info(' No ProjectAsset records to update');
257222
}
258223

259224
// Update SiteAsset paths from resources to site-assets
@@ -265,22 +230,14 @@ protected function updateDatabasePaths(): void
265230
->get();
266231

267232
if ($siteAssetUpdates->isNotEmpty()) {
268-
\Log::info(" Updating {$siteAssetUpdates->count()} SiteAsset records...");
269-
270233
foreach ($siteAssetUpdates as $asset) {
271234
$newPath = str_replace($oldSitePath, $newSitePath, $asset->download_path);
272235

273236
DB::table('site_assets')
274237
->where('id', $asset->id)
275238
->update(['download_path' => $newPath]);
276-
277-
\Log::info("Updated SiteAsset {$asset->id}: {$asset->download_path}{$newPath}");
278239
}
279-
} else {
280-
\Log::info('No SiteAsset records to update');
281240
}
282-
283-
\Log::info('Database path updates completed.');
284241
}
285242

286243
public function processClassifications(): void

app/Jobs/TesseractOcrProcessJob.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public function handle(SqsClient $sqs): void
7272

7373
\Artisan::queue('ocr:listen-controller start')
7474
->onQueue(config('config.queue.default'));
75-
\Log::info('TesseractOcrProcessJob: Starting OCR Lambda');
7675

7776
$sentCount = 0;
7877

app/Jobs/TesseractOcrUpdateJob.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,13 @@ public function failed(Throwable $throwable): void
155155
$queue->save();
156156
}
157157

158+
/*
158159
// Optional: log once per queue, not per file
159160
\Log::error('OCR Update Job failed (queue will be marked errored)', [
160161
'ocrQueueFileId' => $this->ocrQueueFileId ?? 'unknown',
161162
'subjectId' => $this->subjectId ?? 'unknown',
162163
'error' => $throwable->getMessage(),
163164
]);
165+
*/
164166
}
165167
}

app/Jobs/ZooniverseExportDownloadBatchJob.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
use Illuminate\Foundation\Bus\Dispatchable;
2929
use Illuminate\Queue\InteractsWithQueue;
3030
use Illuminate\Queue\SerializesModels;
31-
use Illuminate\Support\Facades\Log;
3231
use Illuminate\Support\Facades\Storage;
3332

3433
class ZooniverseExportDownloadBatchJob implements ShouldQueue
@@ -45,8 +44,6 @@ public function __construct(protected Download $download)
4544

4645
public function handle(SqsClient $sqs): void
4746
{
48-
\Log::info('ZooniverseExportDownloadBatchJob', ['download_id' => $this->download->id]);
49-
5047
$this->download->load('expedition');
5148

5249
$file = $this->download->file;
@@ -70,27 +67,17 @@ public function handle(SqsClient $sqs): void
7067
'updatesQueueUrl' => $updatesQueueUrl,
7168
];
7269

73-
\Log::info('Batch job message', $message);
74-
7570
$sqs->sendMessage([
7671
'QueueUrl' => $triggerQueueUrl,
7772
'MessageBody' => json_encode($message),
7873
]);
7974

80-
Log::info('Batch job queued to Lambda', [
81-
'download_id' => $this->download->id,
82-
'file' => $file,
83-
'size' => $size,
84-
]);
85-
86-
\Log::info('Starting batch supervisor listener.');
8775
\Artisan::call('batch:listen-controller start');
8876
}
8977

9078
private function getQueueUrl(SqsClient $sqs, string $key): string
9179
{
9280
$queueName = config("services.aws.queues.{$key}");
93-
\Log::info("Queue name: {$queueName}");
9481

9582
return $sqs->getQueueUrl(['QueueName' => $queueName])['QueueUrl'];
9683
}

app/Livewire/ProcessMonitor.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,6 @@ private function getExportQueues(): Collection
7878
->orderBy('id')
7979
->get();
8080

81-
// ADD THIS BLOCK
82-
$queues->each(function ($q) {
83-
\Log::info("DEBUG: Queue {$q->id} processed count: {$q->processed_files}");
84-
});
85-
8681
return $queues;
8782
}
8883
}

app/Services/Actor/TesseractOcr/TesseractOcrQueueService.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,12 @@ public function __construct(
5252
public function processNextQueue(bool $reset = false): void
5353
{
5454
if ($this->ocrQueue->where('queued', 1)->where('error', 0)->exists()) {
55-
\Log::info('Queue already running');
56-
5755
return; // Already running one
5856
}
5957

6058
// Find the ID of the next candidate
6159
$nextQueue = $this->getNextQueue($reset);
6260
if (! $nextQueue) {
63-
\Log::info('No queue items available');
64-
6561
return;
6662
}
6763

@@ -87,7 +83,6 @@ public function processNextQueue(bool $reset = false): void
8783
throw new \Exception("TesseractOcr Lambda concurrency is 0 — skipping queue #{$queue->id}");
8884
}
8985

90-
\Log::info("TesseractOcr processing queue #{$queue->id}");
9186
TesseractOcrProcessJob::dispatch($queue);
9287
}
9388

app/Services/Actor/Zooniverse/ZooniverseExportQueueService.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public function processNextQueue(): void
9494
$exportQueue->stage = 1;
9595
$exportQueue->save();
9696

97-
Log::info("Export queue started: {$exportQueue->id}");
9897
ZooniverseExportProcessImagesJob::dispatch($exportQueue);
9998
}
10099

app/Services/Actor/Zooniverse/ZooniverseZipTriggerService.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,16 @@ public function sendZipTrigger(ExportQueue $exportQueue, int $totalSize, int $fi
120120

121121
if ($fileCount > $zipThreshold) {
122122
// Trigger Step Function for large jobs
123-
$result = $this->stepFunctions->startExecution([
123+
$this->stepFunctions->startExecution([
124124
'stateMachineArn' => 'arn:aws:states:us-east-2:147899039648:stateMachine:ZipBatchOrchestrator',
125125
'input' => json_encode($payload),
126126
]);
127-
// TODO Remove this log once we have a better way to track executions
128-
\Log::info("Step Function execution started for {$processDir}: ".$result['executionArn']);
129127
} else {
130128
// Send to SQS for direct Lambda processing for small jobs
131129
$this->sqs->sendMessage([
132130
'QueueUrl' => $queueUrl,
133131
'MessageBody' => json_encode($payload),
134132
]);
135-
\Log::info("SQS message sent for {$processDir} direct processing");
136133
}
137134
}
138135

app/Services/SqsListenerService.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,6 @@ public function sendEmail(string $msg, ?Throwable $e, array $ctx, bool $critical
402402
$m->to($this->adminEmail)->subject($subject);
403403
});
404404

405-
Log::info('Error notification email sent', ['subject' => $subject]);
406405
} catch (Throwable $me) {
407406
Log::error('Failed to send alert email', [
408407
'mail_error' => $me->getMessage(),

0 commit comments

Comments
 (0)