laravel-slow-query-logger
laravel-slow-query-logger copied to clipboard
Log channel and Query time
Hi! In commit https://github.com/rokde/laravel-slow-query-logger/commit/3267feeea085baaa3fcfaa96b648335d3afe271b You use static channel name 'single' (not from config)
And $queryExecuted->time declared as milliseconds
Laravel 5.8
Hi @patrikden , and what is your question or problem in detail?
Hi, @rokde
-
Log channel is always static and does not depend on the value in the configuration (LARAVEL_SLOW_QUERY_LOGGER_CHANNEL)
-
The parameter specified in the configuration LARAVEL_SLOW_QUERY_LOGGER_TIME_TO_LOG as "value in microseconds". Bit in code this parameter used as milliseconds
Hi everyone
IMO this line (64):
Log::channel('single')->log($level, $time . ' ' . $sql);
should be:
Log::channel(config('slow-query-logger.channel', 'daily'))->log($level, $time . 'ms - ' . $sql);