get(LoggerInterface::class); try { // Example log cleanup task $logFile = $storagePath . '/app.log'; if (file_exists($logFile) && filesize($logFile) > 10 * 1024 * 1024) { // 10MB // Rotate log file $backupFile = $storagePath . '/app.log.' . date('Y-m-d_H-i-s'); rename($logFile, $backupFile); $logger->info("Log file rotated to: {$backupFile}"); } $logger->info('Log cleanup check completed'); exit(0); } catch (\Exception $e) { $logger->error('Error during log cleanup: ' . $e->getMessage()); exit(1); }