diff --git a/Neos.ContentRepository.Core/Classes/ContentRepository.php b/Neos.ContentRepository.Core/Classes/ContentRepository.php index 43534f3100..09ee864240 100644 --- a/Neos.ContentRepository.Core/Classes/ContentRepository.php +++ b/Neos.ContentRepository.Core/Classes/ContentRepository.php @@ -55,7 +55,7 @@ * * @api */ -final readonly class ContentRepository +final class ContentRepository { /** * @internal use the {@see ContentRepositoryFactory::getOrBuild()} to instantiate diff --git a/Neos.ContentRepositoryRegistry/Classes/ContentRepositoryRegistry.php b/Neos.ContentRepositoryRegistry/Classes/ContentRepositoryRegistry.php index fc75a43629..5ffe1c220b 100644 --- a/Neos.ContentRepositoryRegistry/Classes/ContentRepositoryRegistry.php +++ b/Neos.ContentRepositoryRegistry/Classes/ContentRepositoryRegistry.php @@ -57,6 +57,9 @@ final class ContentRepositoryRegistry */ private array $factoryInstances = []; + #[Flow\Inject(name: 'Neos.ContentRepositoryRegistry:Logger', lazy: false)] + protected LoggerInterface $logger; + /** * @param array $settings */ @@ -64,7 +67,6 @@ public function __construct( private readonly array $settings, private readonly ObjectManagerInterface $objectManager, private readonly SubgraphCachePool $subgraphCachePool, - private readonly LoggerInterface $logger, ) { } diff --git a/Neos.ContentRepositoryRegistry/Configuration/Objects.yaml b/Neos.ContentRepositoryRegistry/Configuration/Objects.yaml index df582d41eb..f41e1e795a 100644 --- a/Neos.ContentRepositoryRegistry/Configuration/Objects.yaml +++ b/Neos.ContentRepositoryRegistry/Configuration/Objects.yaml @@ -14,3 +14,12 @@ Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalContentGraphProjectionFactory: value: 'Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalContentGraphProjectionFactory' 2: object: 'Doctrine\DBAL\Connection' + +'Neos.ContentRepositoryRegistry:Logger': + className: Psr\Log\LoggerInterface + scope: singleton + factoryObjectName: Neos\Flow\Log\PsrLoggerFactoryInterface + factoryMethodName: get + arguments: + 1: + value: contentRepositoryLogger diff --git a/Neos.ContentRepositoryRegistry/Configuration/Settings.yaml b/Neos.ContentRepositoryRegistry/Configuration/Settings.yaml index d8b2371572..d78307056a 100644 --- a/Neos.ContentRepositoryRegistry/Configuration/Settings.yaml +++ b/Neos.ContentRepositoryRegistry/Configuration/Settings.yaml @@ -12,6 +12,21 @@ Neos: ignoredClasses: Neos\\ContentRepository\\SharedModel\\NodeType\\NodeTypeManager: true + log: + psr3: + 'Neos\Flow\Log\PsrLoggerFactory': + contentRepositoryLogger: + default: + class: Neos\Flow\Log\Backend\FileBackend + options: + # todo context aware? FLOW_APPLICATION_CONTEXT .. but that contains / + logFileURL: '%FLOW_PATH_DATA%Logs/ContentRepository.log' + createParentDirectories: true + severityThreshold: '%LOG_INFO%' + maximumLogFileSize: 10485760 + logFilesToKeep: 1 + logMessageOrigin: false + ContentRepositoryRegistry: contentRepositories: default: