Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
logging: enable/disable database query logging in conf
Browse files Browse the repository at this point in the history
  • Loading branch information
svensp committed Feb 26, 2020
1 parent 76f625b commit 3eff6d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/jaeger.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
return [
'disabled' => env('JAEGER_DISABLE', false),


'log' => [
'database' => env('JAEGER_LOG_DATABASE', false),
'max-string-length' => 300,
'cutoff-indicator' => '...'
],
Expand Down
4 changes: 4 additions & 0 deletions src/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ protected function registerEvents(): void

private function setupQueryLogging()
{
$enabled = config('jaeger.log.database');
$disabled = !$enabled;
if( $disabled )
return;

// Also listen for queries and log then,
// it also receives the log in the MessageLogged event above
Expand Down

0 comments on commit 3eff6d6

Please sign in to comment.