huang-yi/laravel-db-log

Logs database queries for Laravel.

1.6.1 2018-06-11 09:33 UTC

This package is auto-updated.

Last update: 2024-11-12 20:29:29 UTC


README

License Build Status

This package logs your database queries.

Version Compatibility

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.