PHPackages                             halloverden/symfony-doctrine-sql-logger-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. halloverden/symfony-doctrine-sql-logger-bundle

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

halloverden/symfony-doctrine-sql-logger-bundle
==============================================

Better logging of SQL queries in Doctrine DBAL for Symfony.

3.0.0(1y ago)34.5k↓50%3MITPHPPHP &gt;=8.2

Since Sep 22Pushed 1y ago3 watchersCompare

[ Source](https://github.com/halloverden/symfony-doctrine-sql-logger-bundle)[ Packagist](https://packagist.org/packages/halloverden/symfony-doctrine-sql-logger-bundle)[ RSS](/packages/halloverden-symfony-doctrine-sql-logger-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (6)Used By (0)

symfony-doctrine-sql-logger-bundle
==================================

[](#symfony-doctrine-sql-logger-bundle)

Better logging of SQL queries in Doctrine DBAL for Symfony.

Installation
============

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Applications that use Symfony Flex
----------------------------------

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
$ composer require halloverden/symfony-doctrine-sql-logger-bundle
```

Applications that don't use Symfony Flex
----------------------------------------

[](#applications-that-dont-use-symfony-flex)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require halloverden/symfony-doctrine-sql-logger-bundle
```

### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    HalloVerden\DoctrineSqlLoggerBundle\HalloVerdenDoctrineSqlLoggerBundle::class => ['all' => true],
];
```

Configuration
=============

[](#configuration)

By default, all you have to do is require this bundle and it wil log query execution time on the default connection for all queries that takes more than 100 ms.

```
hallo_verden_doctrine_sql_logger:
    loggers:
        -   connection: default
            threshold: 100
            paramsLog: false
            backtraceLog: false
            logger: logger
```

### Change context for specific query

[](#change-context-for-specific-query)

Before executing a query you can change the context by injecting `QueryExecutionTimeLoggerInterface` and add a context:

```
readonly class MyRepository {
    public function __construct(
        private QueryExecutionTimeLoggerInterface $queryExecutionTimeLogger
    ) {
    }

    public function executeQuery(): User {
        $this->queryExecutionTimeLogger->addContext(new QueryExecutionTimeContext(threshold: 500));
        // ... Execute query
    }
}
```

If more than one logger is defined you can inject the correct logger by prefixing the variable name with the connection name. For example `$myConnectionQueryExecutionTimeLogger`

### QueryExecutionTimeEvent

[](#queryexecutiontimeevent)

When a query exceeds the threshold a `QueryExecutionTimeEvent` is dispatched.

Keep in mind that any query executed within this event will not be timed and logged.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 98% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~367 days

Total

5

Last Release

595d ago

Major Versions

1.2.0 → 2.0.02022-09-12

2.0.0 → 3.0.02024-09-30

PHP version history (4 changes)1.0.0PHP ^7.3

1.2.0PHP &gt;=7.3

2.0.0PHP &gt;=8.1

3.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/be037a51f809599999041698e48a3516363d070b3f4af00e1c90f067ac112b3c?d=identicon)[halloverden](/maintainers/halloverden)

![](https://www.gravatar.com/avatar/944da5ba62000d8d54fdeabb71bb8554596caabae0cadcc2433028105c5d80c8?d=identicon)[erichjsonfosse](/maintainers/erichjsonfosse)

![](https://www.gravatar.com/avatar/849015b0be5ad1a1c8aaecb560dd316192468d401d22562fdf685eb75e4106ad?d=identicon)[tomme87](/maintainers/tomme87)

---

Top Contributors

[![tomme87](https://avatars.githubusercontent.com/u/9094256?v=4)](https://github.com/tomme87 "tomme87 (48 commits)")[![erichjsonfosse](https://avatars.githubusercontent.com/u/3193085?v=4)](https://github.com/erichjsonfosse "erichjsonfosse (1 commits)")

### Embed Badge

![Health badge](/badges/halloverden-symfony-doctrine-sql-logger-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/halloverden-symfony-doctrine-sql-logger-bundle/health.svg)](https://phpackages.com/packages/halloverden-symfony-doctrine-sql-logger-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[beyondcode/laravel-server-timing

Add Server-Timing header information from within your Laravel apps.

5712.0M1](/packages/beyondcode-laravel-server-timing)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
