You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was testing using symfony-bridge and hit a few issues. It all started when exceptions causing a 500 error from Symfony would no longer be logged to CloudWatch. It would just stop at the last log message and not log the exception.
I THINK I tracked the issue down to Monolog triggering a handler that logs to a file, and it being unable to log to the file, and thus the error handler itself breaks and it never continues to the stderr logger I have.
It appears related to the copying of the cache folder from project_root/var to /tmp/. The container file that is inside the container folder contains relative references to DIR when initialising services that use kernel.cache_dir or kernel.log_dir. As such, the container is initialising the Monolog service that logs to a file with a cache_dir value of "current directory, one parent". Of course, with standard setup, where cache is in var, this puts it at var/log. Now the issue is when symlinking to /tmp/... DIR is still the var so now cache_dir is var/log still which is unwritable.
I tested changing from symlink to mirror for the container folder but then of course the relative DIR references are all incorrect now so it cannot find the templates folder for twig.
I sense that copying the cache might be causing issues. I can think only way around it is when the cache is "warmed up" locally it likely needs to be generated in the /tmp on the machine and copied in place. Looking at Symfony though it seems it will generate DIR references as long as the cache folder is inside the project folder so only way to avoid it is to generate it outside of that folder.
The text was updated successfully, but these errors were encountered:
Hi,
I was testing using symfony-bridge and hit a few issues. It all started when exceptions causing a 500 error from Symfony would no longer be logged to CloudWatch. It would just stop at the last log message and not log the exception.
I THINK I tracked the issue down to Monolog triggering a handler that logs to a file, and it being unable to log to the file, and thus the error handler itself breaks and it never continues to the stderr logger I have.
It appears related to the copying of the cache folder from project_root/var to /tmp/. The container file that is inside the container folder contains relative references to DIR when initialising services that use kernel.cache_dir or kernel.log_dir. As such, the container is initialising the Monolog service that logs to a file with a cache_dir value of "current directory, one parent". Of course, with standard setup, where cache is in
var
, this puts it atvar/log
. Now the issue is when symlinking to /tmp/... DIR is still thevar
so now cache_dir isvar/log
still which is unwritable.I tested changing from symlink to mirror for the container folder but then of course the relative DIR references are all incorrect now so it cannot find the
templates
folder for twig.I sense that copying the cache might be causing issues. I can think only way around it is when the cache is "warmed up" locally it likely needs to be generated in the
/tmp
on the machine and copied in place. Looking at Symfony though it seems it will generate DIR references as long as the cache folder is inside the project folder so only way to avoid it is to generate it outside of that folder.The text was updated successfully, but these errors were encountered: