$item->getRule(), 'name' => $item->getName(), 'id' => $item->getId(), 'time' => date('Y-m-d H:i:s'), ]; $crontabList[] = $item; if (!$this->isStart) { Worker::safeEcho(sprintf('[%s] [%s] [%s] [%s]', $item['time'], $item['id'], $item['name'], $item['rule']) . "\n"); } } $this->cache->set('crontab_list', $crontabList); $this->isStart = true; } #[Cron('1 0 0 * * *', 'system.cron.change_log_file')] public function changeLogFile(): void { Worker::$logFile = root_path('runtime/log') . date('Ymd') . '.crontab.log'; } }