Logs database queries for Laravel.
Switch branches/tags
Clone or download
Latest commit 8dbd423 Jun 13, 2018
Permalink
Failed to load latest commit information.
config Fixed config. Mar 26, 2018
src Modify debugging judge. Jun 13, 2018
tests tests Dec 8, 2017
.gitignore .gitignore Dec 6, 2017
.travis.yml Removed php v7.0 Apr 8, 2018
LICENSE LICENSE Dec 6, 2017
README-zh.md Updated docs. Apr 8, 2018
README.md Updated docs. Apr 8, 2018
composer.json Compatible Laravel5.6 Mar 26, 2018
phpunit.xml.dist tests Dec 8, 2017

README.md

Laravel DB Log

License Build Status

This package logs your database queries.

Version Compatibility

Laravel Laravel-DB-Log
<=5.5 1.5
5.6 1.6

Installation

$ composer require huang-yi/laravel-db-log:1.6.*

Usage

Add this configuration to your application's .env file:

DB_LOG=true

Configuration

In general, developers do not need to modify any configurations.

If you don't want to keep the default configurations, just copy the following options into the config/logging.php file:

<?php

return [
    'channels' => [
        'db' => [
            'debug' => env('DB_LOG', false),
            'name' => env('DB_LOG_NAME', 'sql'),
            'driver' => env('DB_LOG_DRIVER', 'daily'),
            'path' => storage_path('logs/sql.log'),
            'level' => env('DB_LOG_LEVEL', 'debug'),
            'days' => env('DB_LOG_MAX_FILES', 2),
        ],
    ],
];

Chinese Doc

中文文档

License

The Laravel DB Log package is open-sourced software licensed under the MIT license.