From 6c5eecbf80029981b6236444e1414a69db449645 Mon Sep 17 00:00:00 2001 From: Christian Spoo Date: Mon, 11 Mar 2024 16:31:07 +0100 Subject: [PATCH] Fix Phar path mappings and split Monolog configuration between dev and prod --- config/packages/monolog.yaml | 39 ++++++++++++++++++------------------ src/Kernel.php | 5 +++++ 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/config/packages/monolog.yaml b/config/packages/monolog.yaml index 7f91ad3..faf86e8 100644 --- a/config/packages/monolog.yaml +++ b/config/packages/monolog.yaml @@ -1,22 +1,23 @@ -monolog: - handlers: - main: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" - level: debug - channels: ["!event"] - # uncomment to get logging in your browser - # you may have to allow bigger header sizes in your Web server configuration - #firephp: - # type: firephp - # level: info - #chromephp: - # type: chromephp - # level: info - console: - type: console - process_psr_3_messages: false - channels: ["!event", "!doctrine", "!console"] +when@dev: + monolog: + handlers: + main: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + channels: ["!event"] + # uncomment to get logging in your browser + # you may have to allow bigger header sizes in your Web server configuration + #firephp: + # type: firephp + # level: info + #chromephp: + # type: chromephp + # level: info + console: + type: console + process_psr_3_messages: false + channels: ["!event", "!doctrine", "!console"] when@prod: monolog: diff --git a/src/Kernel.php b/src/Kernel.php index 0e3ab0e..372c8bf 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -12,6 +12,11 @@ class Kernel extends BaseKernel { use MicroKernelTrait; + public function getProjectDir(): string + { + return \dirname(__DIR__); + } + protected function build(ContainerBuilder $container): void { if (!$this->debug) {