fix: [localTool:CommonConnector] Ensure one logger per connector
parent
5eeda6b682
commit
20cc6017d0
|
@ -24,21 +24,24 @@ class CommonConnectorTools
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
Log::setConfig("LocalToolDebug", [
|
if (empty(Log::getConfig("LocalToolDebug{$this->connectorName}"))) {
|
||||||
|
Log::setConfig("LocalToolDebug{$this->connectorName}", [
|
||||||
'className' => FileLog::class,
|
'className' => FileLog::class,
|
||||||
'path' => LOGS,
|
'path' => LOGS,
|
||||||
'file' => "{$this->connectorName}-debug",
|
'file' => "{$this->connectorName}-debug",
|
||||||
'scopes' => [$this->connectorName],
|
'scopes' => [$this->connectorName],
|
||||||
'levels' => ['notice', 'info', 'debug'],
|
'levels' => ['notice', 'info', 'debug'],
|
||||||
]);
|
]);
|
||||||
Log::setConfig("LocalToolError", [
|
}
|
||||||
|
if (empty(Log::getConfig("LocalToolError{$this->connectorName}"))) {
|
||||||
|
Log::setConfig("LocalToolError{$this->connectorName}", [
|
||||||
'className' => FileLog::class,
|
'className' => FileLog::class,
|
||||||
'path' => LOGS,
|
'path' => LOGS,
|
||||||
'file' => "{$this->connectorName}-error",
|
'file' => "{$this->connectorName}-error",
|
||||||
'scopes' => [$this->connectorName],
|
'scopes' => [$this->connectorName],
|
||||||
'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'],
|
'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'],
|
||||||
]);
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function logDebug($message)
|
protected function logDebug($message)
|
||||||
|
|
Loading…
Reference in New Issue