PHPackages                             akshitarora/dblog - 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. [Database &amp; ORM](/categories/database)
4. /
5. akshitarora/dblog

ActiveLibrary[Database &amp; ORM](/categories/database)

akshitarora/dblog
=================

Tool to log heavy database queries in the Laravel application

1.0.1(3y ago)461MITPHP

Since Sep 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/akshit-arora/dblog)[ Packagist](https://packagist.org/packages/akshitarora/dblog)[ RSS](/packages/akshitarora-dblog/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (6)Versions (4)Used By (0)

Laravel DB Log Library
======================

[](#laravel-db-log-library)

[![GitHub](https://camo.githubusercontent.com/c1b9c5abd64dd17207a43d5fee0d3ba5b61f73216e59a037409b284825c35a51/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f616b736869742d61726f72612f64626c6f673f6c6f676f436f6c6f723d677265656e)](https://camo.githubusercontent.com/c1b9c5abd64dd17207a43d5fee0d3ba5b61f73216e59a037409b284825c35a51/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f616b736869742d61726f72612f64626c6f673f6c6f676f436f6c6f723d677265656e)

A simple Laravel library for devs to log your heavy queries bifurcated by the time taken in your application.

Useful when
-----------

[](#useful-when)

- You want to track the queries which are making your application slow.
- You want to monitor the application for the queries which is taking way longer than expected.
- You want to find the slow pages in your application

Features
--------

[](#features)

- Bifurcates the logs datewise so that you can know on what day was your application slow.
- You can also bifurcate the logs based on time taken by the query.

Install
-------

[](#install)

```
composer require akshitarora/dblog

```

Add the ServiceProvider in `app.php`

```
AkshitArora\DbLog\DbLogServiceProvider::class,

```

Log structure
-------------

[](#log-structure)

`[database-name] [time-taken s] SELECT SQL QUERY WHERE PARAMETERS='VALUE' || Path METHOD: /slow/page/here`

Configuration
-------------

[](#configuration)

Publish `dblog.php` configuration file into `/config/` for configuration customization:

```
php artisan vendor:publish --provider=AkshitArora\DbLog\DbLogServiceProvider

```

### Configuration options

[](#configuration-options)

```
