Slow Query Logger for Laravel
, (*1)
Quickstart
composer require rokde/laravel-slow-query-logger
Look into your laravel.log file to see your messy queries., (*2)
Installation
Add to your composer.json following lines, (*3)
"require": {
"rokde/laravel-slow-query-logger": "^1.*"
}
Run php artisan vendor:publish --provider="Rokde\LaravelSlowQueryLogger\LaravelSlowQueryLoggerProvider", (*4)
Configuration
enabled
Enable the slow queries logger., (*5)
You can set this value through environment variable LARAVEL_SLOW_QUERY_LOGGER_ENABLED. It is false by default., (*6)
channel
Sets the channel to log in., (*7)
You can set this value through environment variable LARAVEL_SLOW_QUERY_LOGGER_CHANNEL. It is single by default., (*8)
log-level
Set the log-level for logging the slow queries., (*9)
You can set this value through environment variable LARAVEL_SLOW_QUERY_LOGGER_LOG_LEVEL. It is debug by default., (*10)
time-to-log
Only log queries longer than this value in microseconds., (*11)
You can set this value through environment variable LARAVEL_SLOW_QUERY_LOGGER_TIME_TO_LOG. It is 0.7 by default., (*12)
Usage
Start your application and look into your logs to identify the slow queries., (*13)