* [MOD] Improved logging when performing upgrades

* [MOD] Log to file is turned on when debug mode is active

Signed-off-by: nuxsmin <nuxsmin@syspass.org>
This commit is contained in:
nuxsmin
2018-11-11 12:58:31 +01:00
parent a1639fdf47
commit 0da5c282d6
10 changed files with 40 additions and 33 deletions

View File

@@ -116,16 +116,20 @@ abstract class ModuleBase
/**
* Initializes event handlers
*
* @throws \DI\DependencyException
* @throws \DI\NotFoundException
*/
protected function initEventHandlers()
{
$eventDispatcher = $this->container->get(EventDispatcher::class);
if (DEBUG) {
$eventDispatcher->attach($this->container->get(FileLogHandler::class));
}
if ($this->configData->isLogEnabled()) {
$eventDispatcher->attach($this->container->get(DatabaseLogHandler::class));
if (DEBUG) {
$eventDispatcher->attach($this->container->get(FileLogHandler::class));
}
}
if ($this->configData->isMailEnabled()) {