PHPackages                             tumtum/sw6-sql-logger - 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. tumtum/sw6-sql-logger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

tumtum/sw6-sql-logger
=====================

Returns SQL queries to the Browser or cli.

1.2.0(1y ago)0941GPL-3.0PHP

Since Jul 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/TumTum/sw6-sql-logger)[ Packagist](https://packagist.org/packages/tumtum/sw6-sql-logger)[ RSS](/packages/tumtum-sw6-sql-logger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (4)Used By (0)

Shopware SQL Logger
-------------------

[](#shopware-sql-logger)

Returns all SQL queries into console of a Browser or cli.

Install
-------

[](#install)

`composer require --dev tumtum/sw6-sql-logger`

Usage
-----

[](#usage)

Just set the function `StartSQLLog()` somewhere and from that point on all SQLs will be logged.

```
\StartSQLLog();

$result = $this->productRepository->search(new Criteria(['product.id']), $context);

\StopSQLLog();
```

Usage with VarDumper::dump()
----------------------------

[](#usage-with-vardumperdump)

If you want to dump the SQLs into the `VarDumper::dump()` and put out the result into a HTML file, you can use the following step:

##### Configure the Shopware 6 (one time):

[](#configure-the-shopware-6-one-time)

```
# config/packages/dev/debug.yml
debug:
    dump_destination: tcp://%env(VAR_DUMPER_SERVER)%
```

##### Start the VarDumper server:

[](#start-the-vardumper-server)

```
./bin/console server:dump --format html > ./public/debug.html
```

open in Browser:

##### Start the SQL logger:

[](#start-the-sql-logger)

```
\StartSQLLog(useVarDumper: true);
```

Usage with Ray
--------------

[](#usage-with-ray)

[Ray](https://myray.app/) is a powerful debugging tool for PHP developers.

##### Call in Ray Style:

[](#call-in-ray-style)

```
ray()->showQueries()

// This query will be displayed.
$this->productRepository->search(new Criteria(['product.id']), $context);

ray()->stopShowingQueries();

// This query won't be displayed.
$this->productRepository->search(new Criteria(['product.id']), $context);
```

Alternatively, you can pass a callable to showQueries. Only the queries performed inside that callable will be displayed in Ray. If you include a return type in the callable, the return value will also be returned.

```
// This query won't be displayed.
$this->productRepository->search(new Criteria(['product.id']), $context);

ray()->showQueries(function() {
    // This query will be displayed.
    $this->productRepository->search(new Criteria(['product.id']), $context);
});

$users = ray()->showQueries(function () {
    // This query will be displayed and the collection will be returned.
    return $this->productRepository->search(new Criteria(['product.id']), $context);
});

$this->productRepository->search(new Criteria(['product.id']), $context); // this query won't be displayed.
```

##### Call Classic

[](#call-classic)

```
#Classic
\StartSQLLog(useRayDumper: true);
```

To ensure Ray works correctly, you need to install the corresponding package:

```
composer require --dev spatie/ray
```

Screenshots
-----------

[](#screenshots)

CLI:

[![Example CLI](https://raw.githubusercontent.com/TumTum/sw6-sql-logger/master/img/screenshot-cli.png)](https://raw.githubusercontent.com/TumTum/sw6-sql-logger/master/img/screenshot-cli.png)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance45

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~297 days

Total

3

Last Release

428d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/08ef539c93c95c0ccb3c36d51c8cc86a6276e8e5a8fb3fadd983843b013dbba3?d=identicon)[TumTum](/maintainers/TumTum)

---

Top Contributors

[![TumTum](https://avatars.githubusercontent.com/u/225997?v=4)](https://github.com/TumTum "TumTum (4 commits)")

### Embed Badge

![Health badge](/badges/tumtum-sw6-sql-logger/health.svg)

```
[![Health](https://phpackages.com/badges/tumtum-sw6-sql-logger/health.svg)](https://phpackages.com/packages/tumtum-sw6-sql-logger)
```

###  Alternatives

[symfony/monolog-bridge

Provides integration for Monolog with various Symfony components

2.6k189.7M258](/packages/symfony-monolog-bridge)[rollbar/rollbar

Monitors errors and exceptions and reports them to Rollbar

33723.7M82](/packages/rollbar-rollbar)[illuminate/log

The Illuminate Log package.

6224.3M518](/packages/illuminate-log)[honeybadger-io/honeybadger-php

Honeybadger PHP library

381.5M4](/packages/honeybadger-io-honeybadger-php)[graycore/magento2-stdlogging

A Magento 2 module that changes all logging handlers to stdout

2382.6k](/packages/graycore-magento2-stdlogging)

PHPackages © 2026

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