diff --git a/README.md b/README.md index 6e2ef20..c5d5818 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,9 @@ return [ // Only record queries when the QUERY_LOG_TRIGGER is set in the environment, // or when the trigger HEADER, GET, POST, or COOKIE variable is set. 'trigger' => env('QUERY_LOG_TRIGGER'), + + // Log Channel + 'channel' => 'stack', ], ]; ``` diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 1ae46c3..a227846 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -48,7 +48,8 @@ public function boot() if (count($bindings) > 0) { $realSql = vsprintf($sqlWithPlaceholders, array_map([$pdo, 'quote'], $bindings)); } - Log::debug(sprintf('[%s] [%s] %s | %s: %s', $query->connection->getDatabaseName(), $duration, $realSql, + Log::channel(config('logging.query.channel', config('logging.default'))) + ->debug(sprintf('[%s] [%s] %s | %s: %s', $query->connection->getDatabaseName(), $duration, $realSql, request()->method(), request()->getRequestUri())); }); }