rokde / laravel-slow-query-logger
Slow Query Logger for Laravel
Installs: 38 200
Dependents: 0
Suggesters: 0
Security: 0
Stars: 29
Watchers: 4
Forks: 13
Open Issues: 1
pkg:composer/rokde/laravel-slow-query-logger
Requires
- php: ^7.1.3
- illuminate/database: ^5.6
- illuminate/support: ^5.6
This package is auto-updated.
Last update: 2023-03-23 02:42:40 UTC
README
Quickstart
composer require rokde/laravel-slow-query-logger
Look into your laravel.log file to see your messy queries.
Installation
Add to your composer.json following lines
"require": {
"rokde/laravel-slow-query-logger": "^1.*"
}
Run php artisan vendor:publish --provider="Rokde\LaravelSlowQueryLogger\LaravelSlowQueryLoggerProvider"
Configuration
enabled
Enable the slow queries logger.
You can set this value through environment variable LARAVEL_SLOW_QUERY_LOGGER_ENABLED. It is false by default.
channel
Sets the channel to log in.
You can set this value through environment variable LARAVEL_SLOW_QUERY_LOGGER_CHANNEL. It is single by default.
log-level
Set the log-level for logging the slow queries.
You can set this value through environment variable LARAVEL_SLOW_QUERY_LOGGER_LOG_LEVEL. It is debug by default.
time-to-log
Only log queries longer than this value in microseconds.
You can set this value through environment variable LARAVEL_SLOW_QUERY_LOGGER_TIME_TO_LOG. It is 0.7 by default.
Usage
Start your application and look into your logs to identify the slow queries.