rokde/laravel-slow-query-logger

Log channel and Query time

patrikden opened this issue · 3 comments

Hi!
In commit 3267fee
You use static channel name 'single' (not from config)

And $queryExecuted->time declared as milliseconds

Laravel 5.8

rokde commented

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

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

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