LogCleanupTaskHandler example



    /** * @param list<string> $expectedMessages */
    private function runWithOptions(int $age, int $maxEntries, array $expectedMessages): void
    {
        $this->systemConfigService->set('core.logging.entryLifetimeSeconds', $age);
        $this->systemConfigService->set('core.logging.entryLimit', $maxEntries);
        $this->writeLogs();

        $handler = new LogCleanupTaskHandler(
            $this->scheduledTaskRepository,
            $this->systemConfigService,
            $this->connection
        );

        $handler->run();

        $results = $this->logEntryRepository->search(new Criteria()$this->context);
        static::assertEquals(\count($expectedMessages)$results->getTotal());

        $entries = $results->getEntities();
        
Home | Imprint | This part of the site doesn't use cookies.