Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

SQL logger should not be replaced #46

@Mairu

Description

@Mairu

Currently the previously set logger is overwritten by the bundle in the compiler pass.

        $doctrine = $container->getParameter('doctrine.connections');

        foreach ($doctrine as $connectionId) {
            $container
                ->getDefinition(sprintf('%s.configuration', $connectionId))
                ->addMethodCall('setSQLLogger', [new Reference('app_insights_php.doctrine.logger.dependency')]);
        }

As there is already a logger chain defined where the logger can be added to (at least for me in symfony 4.4 with doctrine 2.7) the logger should be added to that chain instead of replacing it.

        $container->getDefinition('doctrine.dbal.logger.chain')
            ->addMethodCall('addLogger', [new Reference('app_insights_php.doctrine.logger.dependency')]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions