Skip to content

Commit e33dbfa

Browse files
committed
feature symfony#58564 [HttpKernel] Let Monolog handle the creation of log folder for improved readonly containers handling (shyim)
This PR was merged into the 7.3 branch. Discussion ---------- [HttpKernel] Let Monolog handle the creation of log folder for improved readonly containers handling | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT When running Symfony in a Container in readonly mode. Symfony checks if the var/log is writeable and it's not because of readonly FS. I can set env `APP_LOG_DIR=/tmp/log`, to fix the issue. But this folder will be never used as my monolog only outputs to stdout. Therefore I would suggest removing this completely and let monolog create the folder, only when the user configuration wants this Commits ------- c79d340 [HttpKernel] Let Monolog create the log folder
2 parents b107be4 + c79d340 commit e33dbfa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ protected function getKernelParameters(): array
594594
*/
595595
protected function buildContainer(): ContainerBuilder
596596
{
597-
foreach (['cache' => $this->getCacheDir(), 'build' => $this->warmupDir ?: $this->getBuildDir(), 'logs' => $this->getLogDir()] as $name => $dir) {
597+
foreach (['cache' => $this->getCacheDir(), 'build' => $this->warmupDir ?: $this->getBuildDir()] as $name => $dir) {
598598
if (!is_dir($dir)) {
599599
if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) {
600600
throw new \RuntimeException(\sprintf('Unable to create the "%s" directory (%s).', $name, $dir));

0 commit comments

Comments
 (0)