Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix elasticsearch logger error
  • Loading branch information
LordSimal committed Oct 30, 2023
commit 3f091eac1e3a1a615c2771d681e1c1b89e3e74ea
10 changes: 9 additions & 1 deletion src/Panel/SqlLogPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
namespace DebugKit\Panel;

use Cake\Core\Configure;
use Cake\Database\Driver;
use Cake\Datasource\ConnectionInterface;
use Cake\Datasource\ConnectionManager;
use Cake\ORM\Locator\LocatorAwareTrait;
Expand Down Expand Up @@ -57,7 +58,14 @@ public function initialize(): void
) {
continue;
}
$logger = $connection->getDriver()->getLogger();
$driver = $connection->getDriver();
$logger = null;
if ($driver instanceof Driver) {
$logger = $driver->getLogger();
} elseif (method_exists($connection, 'getLogger')) {
// ElasticSearch connection holds the logger, not the Elastica Driver
$logger = $connection->getLogger();
}

if ($logger instanceof DebugLog) {
$logger->setIncludeSchema($includeSchemaReflection);
Expand Down