refactor(php): Rebuild logging setup

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2024-05-09 12:27:13 +02:00
parent 9c272956c9
commit 9fe1ad9abf
7 changed files with 49 additions and 158 deletions

View File

@@ -61,9 +61,7 @@ abstract class ModuleBase implements ModuleInterface
*/
protected function initEventHandlers(bool $partialInit = false): void
{
if (DEBUG || $this->configData->isDebug() || !$this->configData->isInstalled()) {
$this->eventDispatcher->attach($this->providersHelper->getFileLogHandler());
}
$this->eventDispatcher->attach($this->providersHelper->getLogHandler());
if ($partialInit || !$this->configData->isInstalled()) {
return;
@@ -77,14 +75,6 @@ abstract class ModuleBase implements ModuleInterface
$this->eventDispatcher->attach($this->providersHelper->getMailHandler());
}
if ($this->configData->isSyslogEnabled()) {
$this->eventDispatcher->attach($this->providersHelper->getSyslogHandler());
}
if ($this->configData->isSyslogRemoteEnabled()) {
$this->eventDispatcher->attach($this->providersHelper->getRemoteSyslogHandler());
}
$this->eventDispatcher->attach($this->providersHelper->getAclHandler());
$this->eventDispatcher->attach($this->providersHelper->getNotificationHandler());
}