Commit 46e4cef8 authored by Tino Goratsch's avatar Tino Goratsch

separated the system logger from the error handler logger

parent 7d6b6ca6
......@@ -9,6 +9,7 @@ namespace ACP3\Core\Application;
use ACP3\Core\Environment\ApplicationPath;
use ACP3\Core\ErrorHandler;
use ACP3\Core\Logger\LoggerFactory;
use Psr\Log\LoggerInterface;
abstract class AbstractBootstrap implements BootstrapInterface
......@@ -32,12 +33,13 @@ abstract class AbstractBootstrap implements BootstrapInterface
/**
* @param string $appMode
* @throws \Exception
*/
public function __construct($appMode)
{
$this->appMode = $appMode;
$this->initializeApplicationPath();
$this->logger = (new \ACP3\Core\Logger\LoggerFactory($this->appPath))->create('system');
$this->logger = (new LoggerFactory($this->appPath))->create('error');
}
protected function initializeApplicationPath()
......
......@@ -57,7 +57,6 @@ class Bootstrap extends AbstractBootstrap
$this->container = new \ACP3ServiceContainer();
$this->container->set('core.environment.application_path', $this->appPath);
$this->container->set('core.http.symfony_request', $symfonyRequest);
$this->container->set('core.logger.system_logger', $this->logger);
}
/**
......@@ -70,10 +69,7 @@ class Bootstrap extends AbstractBootstrap
if (!$containerConfigCache->isFresh()) {
$containerBuilder = ServiceContainerBuilder::create(
$this->logger,
$this->appPath,
$symfonyRequest,
$this->appMode
$this->appPath, $symfonyRequest, $this->appMode
);
$dumper = new PhpDumper($containerBuilder);
......
......@@ -16,7 +16,6 @@ use ACP3\Core\Modules;
use ACP3\Core\Validation\DependencyInjection\RegisterValidationRulesPass;
use ACP3\Core\View\Renderer\Smarty\DependencyInjection\RegisterSmartyPluginsPass;
use ACP3\Core\WYSIWYG\DependencyInjection\RegisterWysiwygEditorsCompilerPass;
use Psr\Log\LoggerInterface;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
......@@ -25,10 +24,6 @@ use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
class ServiceContainerBuilder extends ContainerBuilder
{
/**
* @var LoggerInterface
*/
private $logger;
/**
* @var ApplicationPath
*/
......@@ -44,21 +39,15 @@ class ServiceContainerBuilder extends ContainerBuilder
/**
* ServiceContainerBuilder constructor.
*
* @param LoggerInterface $logger
* @param ApplicationPath $applicationPath
* @param SymfonyRequest $symfonyRequest
* @param string $applicationMode
*/
public function __construct(
LoggerInterface $logger,
ApplicationPath $applicationPath,
SymfonyRequest $symfonyRequest,
$applicationMode
ApplicationPath $applicationPath, SymfonyRequest $symfonyRequest, $applicationMode
) {
parent::__construct();
$this->logger = $logger;
$this->applicationPath = $applicationPath;
$this->symfonyRequest = $symfonyRequest;
$this->applicationMode = $applicationMode;
......@@ -68,7 +57,6 @@ class ServiceContainerBuilder extends ContainerBuilder
private function setUpContainer()
{
$this->set('core.logger.system_logger', $this->logger);
$this->set('core.http.symfony_request', $this->symfonyRequest);
$this->set('core.environment.application_path', $this->applicationPath);
$this->setParameter('core.environment', $this->applicationMode);
......@@ -112,20 +100,15 @@ class ServiceContainerBuilder extends ContainerBuilder
}
/**
* @param LoggerInterface $logger
* @param \ACP3\Core\Environment\ApplicationPath $applicationPath
* @param SymfonyRequest $symfonyRequest
* @param string $applicationMode
*
* @return ContainerBuilder
*/
public static function create(
LoggerInterface $logger,
ApplicationPath $applicationPath,
SymfonyRequest $symfonyRequest,
$applicationMode
ApplicationPath $applicationPath, SymfonyRequest $symfonyRequest, $applicationMode
) {
return new static($logger, $applicationPath, $symfonyRequest, $applicationMode);
return new static($applicationPath, $symfonyRequest, $applicationMode);
}
/**
......
......@@ -35,6 +35,7 @@ class LoggerFactory
* @param string $level
*
* @return LoggerInterface
* @throws \Exception
*/
public function create($channel, $level = LogLevel::DEBUG)
{
......
......@@ -11,4 +11,6 @@ services:
core.logger.system_logger:
class: Psr\Log\LoggerInterface
synthetic: true
factory: 'core.logger.logger_factory:create'
arguments:
- 'system'
......@@ -9,7 +9,6 @@ namespace ACP3\Modules\ACP3\System\Helper;
use ACP3\Core;
use ACP3\Core\XML;
use Psr\Log\LoggerInterface;
class Installer
{
......@@ -35,17 +34,12 @@ class Installer
* @var \ACP3\Core\XML
*/
protected $xml;
/**
* @var LoggerInterface
*/
private $logger;
/**
* @var Core\Installer\SchemaRegistrar
*/
private $schemaRegistrar;
/**
* @param LoggerInterface $logger
* @param \ACP3\Core\Environment\ApplicationPath $appPath
* @param \ACP3\Core\Modules $modules
* @param \ACP3\Core\Modules\Vendor $vendors
......@@ -54,7 +48,6 @@ class Installer
* @param \ACP3\Core\XML $xml
*/
public function __construct(
LoggerInterface $logger,
Core\Environment\ApplicationPath $appPath,
Core\Modules $modules,
Core\Modules\Vendor $vendors,
......@@ -67,7 +60,6 @@ class Installer
$this->vendors = $vendors;
$this->schemaInstaller = $schemaInstaller;
$this->xml = $xml;
$this->logger = $logger;
$this->schemaRegistrar = $schemaRegistrar;
}
......
......@@ -2,7 +2,6 @@ services:
system.helpers.installer:
class: ACP3\Modules\ACP3\System\Helper\Installer
arguments:
- '@core.logger.system_logger'
- '@core.environment.application_path'
- '@core.modules'
- '@core.modules.vendors'
......
......@@ -27,7 +27,7 @@ HTML;
}
$cacheStore = new \Toflar\Psr6HttpCacheStore\Psr6Store([
'cache_directory' => $kernel->getAppPath()->getCacheDir() . 'http/',
'cache_directory' => __DIR__ . '/cache/' . $appMode . '/http',
]);
$appCache = new \ACP3\Core\Application\BootstrapCache(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment