hoannc54/laravel-query-logger is a Laravel package for slow query logger for laravel.
It currently has 0 GitHub stars and 114 downloads on Packagist (latest version 1.0.5).
Install it with composer require hoannc54/laravel-query-logger.
Discover more Laravel packages by hoannc54
or browse all Laravel packages to compare alternatives.
Last updated
composer require hoannc54/laravel-query-logger
Look into your laravel.log file to see your messy queries.
Add to your composer.json following lines
"require": {
"hoannc54/laravel-query-logger": "^1.*"
}
Run php artisan vendor:publish --provider="Workable\QueryLogger\QueryLoggerProvider"
enabledEnable the slow queries logger.
You can set this value through environment variable LARAVEL_SLOW_QUERY_LOGGER_ENABLED. It is false by default.
channelSets the channel to log in.
You can set this value through environment variable LARAVEL_SLOW_QUERY_LOGGER_CHANNEL. It is single by default.
log-levelSet 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-logOnly 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.
Start your application and look into your logs to identify the slow queries.