Files
rspade_system/app/RSpade/Commands/Rsx/Log_Rotate_Command.php
root f6fac6c4bc Fix bin/publish: copy docs.dist from project root
Fix bin/publish: use correct .env path for rspade_system
Fix bin/publish script: prevent grep exit code 1 from terminating script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 02:08:33 +00:00

52 lines
1.3 KiB
PHP
Executable File

<?php
namespace App\RSpade\Commands\Rsx;
use App\Console\Commands\FrameworkDeveloperCommand;
use App\RSpade\Core\Debug\Debugger;
/**
* RSX Log Rotate Command
*
* Rotates all development logs (Laravel and nginx).
* Only available in non-production environments.
*/
class Log_Rotate_Command extends FrameworkDeveloperCommand
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'rsx:logrotate';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Rotate all development logs (Laravel and nginx) - development only';
/**
* Execute the console command.
*/
public function handle()
{
// Check environment - throw fatal error in production
if (app()->environment('production')) {
throw new \RuntimeException('FATAL: rsx:logrotate command is not available in production environment. This is a development-only debugging tool.');
}
$this->info('Rotating development logs...');
// Rotate all logs
Debugger::logrotate();
$this->info('✅ Logs rotated successfully:');
$this->info(' - Laravel log');
$this->info(' - Nginx access log');
$this->info(' - Nginx error log');
return 0;
}
}