From 8e91d70ea6751e69b3309b119fea833934b3c19e Mon Sep 17 00:00:00 2001 From: Frank Dekker Date: Sun, 30 Nov 2025 15:45:24 +0100 Subject: [PATCH 1/4] Fill config based on override --- src/DependencyInjection/Configuration.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 74cbe2c1..f9bc4418 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -168,6 +168,8 @@ private function normalizeConfig(array $config): array $config['monolog']['finder']['in'] ??= '%kernel.logs_dir%'; $config['monolog']['finder']['name'] ??= '*.log'; $config['monolog']['finder']['depth'] ??= '== 0'; + $config['start_of_line_pattern'] ??= MonologLineParser::START_OF_MESSAGE_PATTERN; + $config['log_message_pattern'] ??= MonologLineParser::LOG_LINE_PATTERN; return $config; } From e4010af9e00df0be608644ee8d58ab32816be170 Mon Sep 17 00:00:00 2001 From: Frank Dekker Date: Sun, 30 Nov 2025 15:47:49 +0100 Subject: [PATCH 2/4] Fill config based on override --- src/DependencyInjection/Configuration.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index f9bc4418..7ac81281 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -163,13 +163,13 @@ private function normalizeConfig(array $config): array return $config; } - $config['monolog']['type'] ??= 'monolog'; - $config['monolog']['name'] ??= 'Monolog'; - $config['monolog']['finder']['in'] ??= '%kernel.logs_dir%'; - $config['monolog']['finder']['name'] ??= '*.log'; - $config['monolog']['finder']['depth'] ??= '== 0'; - $config['start_of_line_pattern'] ??= MonologLineParser::START_OF_MESSAGE_PATTERN; - $config['log_message_pattern'] ??= MonologLineParser::LOG_LINE_PATTERN; + $config['monolog']['type'] ??= 'monolog'; + $config['monolog']['name'] ??= 'Monolog'; + $config['monolog']['finder']['in'] ??= '%kernel.logs_dir%'; + $config['monolog']['finder']['name'] ??= '*.log'; + $config['monolog']['finder']['depth'] ??= '== 0'; + $config['monolog']['start_of_line_pattern'] ??= MonologLineParser::START_OF_MESSAGE_PATTERN; + $config['monolog']['log_message_pattern'] ??= MonologLineParser::LOG_LINE_PATTERN; return $config; } From 15171fd49a1ab787355e744e4367ad722decd87b Mon Sep 17 00:00:00 2001 From: Frank Dekker Date: Sun, 30 Nov 2025 15:49:19 +0100 Subject: [PATCH 3/4] Update tests --- .../data/expected-merge-monolog-config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Integration/DependencyInjection/data/expected-merge-monolog-config.json b/tests/Integration/DependencyInjection/data/expected-merge-monolog-config.json index 9182266f..a83304fd 100644 --- a/tests/Integration/DependencyInjection/data/expected-merge-monolog-config.json +++ b/tests/Integration/DependencyInjection/data/expected-merge-monolog-config.json @@ -12,8 +12,8 @@ "ignoreUnreadableDirs": true, "followLinks": false }, - "start_of_line_pattern": null, - "log_message_pattern": null, + "start_of_line_pattern": "/^\\[\\d{4}-\\d{2}-\\d{2}[^]]*]\\s+\\S+\\.\\S+:/", + "log_message_pattern": "/^\\[(?P[^\\]]+)\\]\\s+(?P[^\\.]+)\\.(?P[^:]+):\\s+(?P.*)\\s+(?P(?:{.*?}|\\[.*?]))\\s+(?P(?:{.*?}|\\[.*?]))\\s+$/s", "date_format": null } }, From 519033edf64f4da064ad19fbe51e5916a382cc5f Mon Sep 17 00:00:00 2001 From: Frank Dekker Date: Sun, 30 Nov 2025 15:53:00 +0100 Subject: [PATCH 4/4] Fix test time issue --- tests/Unit/Controller/DeleteFileControllerTest.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/Unit/Controller/DeleteFileControllerTest.php b/tests/Unit/Controller/DeleteFileControllerTest.php index 36eb19d1..90590dca 100644 --- a/tests/Unit/Controller/DeleteFileControllerTest.php +++ b/tests/Unit/Controller/DeleteFileControllerTest.php @@ -12,7 +12,6 @@ use PHPUnit\Framework\MockObject\MockObject; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -69,9 +68,8 @@ public function testInvokeSuccess(): void $this->filesystem->expects(self::once())->method('remove')->with('path'); $this->fileService->expects(self::once())->method('findFileByIdentifier')->with('identifier')->willReturn($logFile); - $expected = new JsonResponse(['success' => true]); $response = ($this->controller)('identifier'); - static::assertEquals($expected, $response); + static::assertEquals('{"success":true}', $response->getContent()); } public function getController(): AbstractController