PHPackages                             brandworks/querylogger - 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. brandworks/querylogger

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

brandworks/querylogger
======================

Trace or log your (slow) queries in Laravel 4

v1.0.0(10y ago)263MITPHPPHP &gt;=5.4.0

Since Jan 5Pushed 10y ago1 watchersCompare

[ Source](https://github.com/hansvn/laravel-querylogger)[ Packagist](https://packagist.org/packages/brandworks/querylogger)[ RSS](/packages/brandworks-querylogger/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel Query Logger
====================

[](#laravel-query-logger)

This package allows you to log and trace your queries. For example: if you have some slow queries you can find where they are called.

Requirements
------------

[](#requirements)

- PHP &gt;=5.4
- LARAVEL 4.2

Getting started
---------------

[](#getting-started)

### Laravel 4.2

[](#laravel-42)

1. Install the `brandworks/querylogger` package

    ```
    $ composer require brandworks/querylogger
    ```
2. Update app/config/app.php` to activate the package

    ```
    # Add `Brandworks\Querylogger\QueryloggerServiceProvider` to the `providers` array
    'providers' => array(
        ...
        'Brandworks\Querylogger\QueryloggerServiceProvider',
    )

    # You do not need to add the alias - This is being handled for you in the service provider
    ```
3. Publish the config file

    ```
    $ php artisan config:publish brandworks/querylogger
    ```
4. Optionally, you can change the options

---

You can also add a route to your application to directly view your logs in a table

1. In the config: set the add\_route and store\_serialized options to true

    ```
    # file: app/config/packages/brandworks/querylogger/config.php
    'store_serialized' => false,
    'add_route' => false,
    ```
2. You can optionally set the route you want to view your queries at

    ```
    # file: app/config/packages/brandworks/querylogger/config.php
    'route' => 'queries',
    ```

> I don't recommend to enable this in a live environment; Your visitors can view your queries and deduct your database structure once they have found the route!

> So if you are to add the routes do this in a local config file.

Usage
-----

[](#usage)

Below is a simple usage example of this package

```
//this does not affect user load since this is done in app finish (the client did already receive response)
App::finish(function($request, $response) {
    //make sure the package is enabled -- prevent errors
    if(class_exists("QueryLogger")) {
        $queryLog = QueryLogger::getLog();

        Log::info('The query log', $queryLog);
        //or do some other stuff with the log so you can make it more readale/filter on query time/...
    }
}
```

Contributing
------------

[](#contributing)

Contributions are welcome.

Todo's
------

[](#todos)

- Write tests

Licence
-------

[](#licence)

This project is licensed under the terms of the MIT license.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

3831d ago

### Community

Maintainers

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

---

Tags

laravelquery loggerquery tracerquery locationbrandworks

### Embed Badge

![Health badge](/badges/brandworks-querylogger/health.svg)

```
[![Health](https://phpackages.com/badges/brandworks-querylogger/health.svg)](https://phpackages.com/packages/brandworks-querylogger)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[open-telemetry/opentelemetry-auto-laravel

OpenTelemetry auto-instrumentation for Laravel

592.7M9](/packages/open-telemetry-opentelemetry-auto-laravel)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14845.8k1](/packages/guanguans-laravel-exception-notify)[nightowl/agent

NightOwl monitoring agent — collects telemetry from laravel/nightwatch and writes to PostgreSQL

771.7k](/packages/nightowl-agent)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[api-platform/laravel

API Platform support for Laravel

58170.8k14](/packages/api-platform-laravel)

PHPackages © 2026

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