// ready.php
$this->addHook('WireLog::save', function(HookEvent $event) {
// Prune all log files
foreach(wire('log')->getLogs() as $logFile) {
wire('log')->prune($logFile['name'], 7);
}
// Or just the current log file
wire('log')->prune($event->arguments[0], 7);
});
Not really tested ?