Skip to content

Commit

Permalink
TASK: Introduce dedicated contentRepositoryLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Nov 20, 2024
1 parent 8967ead commit 2b5d338
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Neos.ContentRepository.Core/Classes/ContentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
*
* @api
*/
final readonly class ContentRepository
final class ContentRepository
{
/**
* @internal use the {@see ContentRepositoryFactory::getOrBuild()} to instantiate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ final class ContentRepositoryRegistry
*/
private array $factoryInstances = [];

#[Flow\Inject(name: 'Neos.ContentRepositoryRegistry:Logger', lazy: false)]
protected LoggerInterface $logger;

/**
* @param array<string, mixed> $settings
*/
public function __construct(
private readonly array $settings,
private readonly ObjectManagerInterface $objectManager,
private readonly SubgraphCachePool $subgraphCachePool,
private readonly LoggerInterface $logger,
) {
}

Expand Down
9 changes: 9 additions & 0 deletions Neos.ContentRepositoryRegistry/Configuration/Objects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 15 additions & 0 deletions Neos.ContentRepositoryRegistry/Configuration/Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2b5d338

Please sign in to comment.