Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging: allow disabling logging for all connections #1500

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

glaubinix
Copy link
Contributor

Having one or multiple connections set up and all of them logging: false configured, activates logging via Middleware for all connection.

Sample configuration:

doctrine:
    dbal:
        connections:
            default:
                driver: 'pdo_pgsql'
                url: '%env(DATABASE_URL)%'
                logging: false

The middlewares.xml defines a doctrine.middleware tag by default for Doctrine\DBAL\Logging\Middleware, which the MiddlewaresPass then applies to all connections. Having one or more connections with logging: true will overwrite the tag and set connections to an array of connections, which then only enables logging for those configured connections. That second part is working as expected.

@dmaicher
Copy link
Contributor

dmaicher commented Apr 5, 2022

@l-vo can you have a look at this too?

@l-vo
Copy link
Contributor

l-vo commented Apr 5, 2022

LGTM too, thank you :)

@dmaicher dmaicher merged commit 6696146 into doctrine:2.6.x Apr 5, 2022
@dmaicher
Copy link
Contributor

dmaicher commented Apr 5, 2022

Thank you @glaubinix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants