-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] Let Monolog handle the creation of log folder for improved readonly containers handling #58564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
How will the app behave of monolog is not used? And how does monolog fail if configurated to write there? |
No
When logging it throws a exception:
|
I think we periodically wonder about this, and the conclusion has also been: a writeable var/log is a feature of the kernel, it doesn't relate to monolog directly. |
Maybe deprecate it for Symfony 8.0, remove this method, and rely only on configuration for path /var/log?
Sure I can set APP_LOG_DIR to tmpdir, it feels hacky. Symfony Cloud (platform.sh) seems to have a hack that this folder is always writeable, it would also improve the official Symfony product |
As mentioned by @nicolas-grekas, we've had this conversation a few times now. I think more and more containers are read-only nowadays. I'm fine with this change, but probably not as a bug fix for 5.4. I would be ok to merge it in 7.2 though. |
updated the target branch |
Thank you @shyim. |
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