Skip to content

Commit

Permalink
feat: update logging level to debug (#126)
Browse files Browse the repository at this point in the history
Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
  • Loading branch information
huangdijia and huangdijia authored Dec 23, 2024
1 parent 3c365e8 commit 00c4b8d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions src/MySQLReplication/BinLog/BinLogSocketConnect.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public function __construct(

$this->socket->connectToStream($config->host, $config->port);

$this->logger->info('Connected to ' . $config->host . ':' . $config->port);
$this->logger->debug('Connected to ' . $config->host . ':' . $config->port);

$this->binLogServerInfo = BinLogServerInfo::make(
$this->getResponse(false),
$this->repository->getVersion()
);

$this->logger->info(
$this->logger->debug(
'Server version name: ' . $this->binLogServerInfo->versionName . ', revision: ' . $this->binLogServerInfo->versionRevision
);

Expand Down Expand Up @@ -113,7 +113,7 @@ private function isWriteSuccessful(string $data): void

private function authenticate(BinLogAuthPluginMode $authPlugin): void
{
$this->logger->info(
$this->logger->debug(
'Trying to authenticate user: ' . $this->config->user . ' using ' . $authPlugin->value . ' default plugin'
);

Expand All @@ -137,7 +137,7 @@ private function authenticate(BinLogAuthPluginMode $authPlugin): void
$this->switchAuth($response);
}

$this->logger->info('User authenticated');
$this->logger->debug('User authenticated');
}

private function getAuthData(?BinLogAuthPluginMode $authPlugin, string $salt): string
Expand Down Expand Up @@ -196,15 +196,15 @@ private function getBinlogStream(): void
// master_heartbeat_period is in nanoseconds
$this->executeSQL('SET @master_heartbeat_period = ' . $this->config->heartbeatPeriod * 1000000000);

$this->logger->info('Heartbeat period set to ' . $this->config->heartbeatPeriod . ' seconds');
$this->logger->debug('Heartbeat period set to ' . $this->config->heartbeatPeriod . ' seconds');
}

if ($this->config->slaveUuid !== '') {
$this->executeSQL(
'SET @slave_uuid = \'' . $this->config->slaveUuid . '\', @replica_uuid = \'' . $this->config->slaveUuid . '\''
);

$this->logger->info('Salve uuid set to ' . $this->config->slaveUuid);
$this->logger->debug('Salve uuid set to ' . $this->config->slaveUuid);
}

$this->registerSlave();
Expand Down Expand Up @@ -251,7 +251,7 @@ private function registerSlave(): void
$this->socket->writeToSocket($data);
$this->getResponse();

$this->logger->info('Slave registered with id ' . $this->config->slaveId);
$this->logger->debug('Slave registered with id ' . $this->config->slaveId);
}

private function setBinLogDumpMariaGtid(): void
Expand All @@ -263,7 +263,7 @@ private function setBinLogDumpMariaGtid(): void

$this->binLogCurrent->setMariaDbGtid($this->config->mariaDbGtid);

$this->logger->info('Set Maria GTID to start from: ' . $this->config->mariaDbGtid);
$this->logger->debug('Set Maria GTID to start from: ' . $this->config->mariaDbGtid);
}

private function setBinLogDumpGtid(): void
Expand All @@ -286,7 +286,7 @@ private function setBinLogDumpGtid(): void

$this->binLogCurrent->setGtid($this->config->gtid);

$this->logger->info('Set GTID to start from: ' . $this->config->gtid);
$this->logger->debug('Set GTID to start from: ' . $this->config->gtid);
}

/**
Expand Down Expand Up @@ -319,7 +319,7 @@ private function setBinLogDump(): void
$this->binLogCurrent->setBinLogPosition($binFilePos);
$this->binLogCurrent->setBinFileName($binFileName);

$this->logger->info('Set binlog to start from: ' . $binFileName . ':' . $binFilePos);
$this->logger->debug('Set binlog to start from: ' . $binFileName . ':' . $binFilePos);
}

private function switchAuth(string $response): void
Expand All @@ -330,7 +330,7 @@ private function switchAuth(string $response): void
$salt = BinaryDataReader::decodeNullLength($response, $offset);
$auth = $this->getAuthData($authPluginSwitched, $salt);

$this->logger->info('Auth switch packet received, switching to ' . $authPluginSwitched->value);
$this->logger->debug('Auth switch packet received, switching to ' . $authPluginSwitched->value);

$this->socket->writeToSocket(pack('L', (strlen($auth)) | (3 << 24)) . $auth);
}
Expand Down
2 changes: 1 addition & 1 deletion src/MySQLReplication/Event/RowEvent/RowEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ protected function findTableMap(): ?TableMap
return $this->tableMapCache->get($tableId);
}

$this->logger->info('No table map found for table ID: ' . $tableId);
$this->logger->debug('No table map found for table ID: ' . $tableId);

return null;
}
Expand Down

0 comments on commit 00c4b8d

Please sign in to comment.