laravel-slow-query-logger icon indicating copy to clipboard operation
laravel-slow-query-logger copied to clipboard

Log channel and Query time

Open patrikden opened this issue 5 years ago • 3 comments

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

patrikden avatar May 10 '19 18:05 patrikden

Hi @patrikden , and what is your question or problem in detail?

rokde avatar May 13 '19 06:05 rokde

Hi, @rokde

  1. Log channel is always static and does not depend on the value in the configuration (LARAVEL_SLOW_QUERY_LOGGER_CHANNEL)

  2. 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

patrikden avatar May 13 '19 06:05 patrikden

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);

dhcmega avatar Oct 09 '19 13:10 dhcmega