feat(logging): implement log pruning functionality

- Add LogPruneService to handle the deletion of old logs based on retention settings.
- Create PruneLogsCommand to provide a console command for log pruning.
- Introduce PruneLogsMessage and PruneLogsHandler for message handling related to log pruning.
- Update the AST cache with new classes and their relationships.
This commit is contained in:
hamed
2026-07-01 21:50:51 +03:30
parent a31e8b4314
commit 7814bcc0de
27 changed files with 1667 additions and 802 deletions
@@ -1989,4 +1989,12 @@ class AdminApiController extends BaseController
'created_at' => (int) $l['createdAt'],
], $rows), (int) $total, $page, $limit);
}
#[Route('/api/v1/admin/logs', methods: ['DELETE'])]
public function clearLogs(): JsonResponse
{
$deleted = $this->em->getRepository(AppLog::class)->deleteAll();
return $this->success(['deleted' => $deleted]);
}
}