I set my project to prod
mode in .env
and everything aside from the custom error pages seem to work.
I have this as my 404 twig template:
{# templates/bundles/TwigBundle/Exception/error404.html.twig #}
{% include 'builder/layout/header.html.twig' with {'title': '404'} %}
<img src="{{ assets('img/not-found.jpeg') }}" class="img-responsive"
id="error-not-found-img" />
<div class="http-error-msg-container">
<h1>404! Page Not Found</h1>
<p>Don't despair, go back to <a href="{{ path('dashboard') }}">Home</a> and try again.</p>
</div>
{% include 'builder/layout/footer.html.twig' %}
and going to a non-existant page (say /dashboard/giorgoirdjfisejf
) returns a blank page. So I added this to my index.php
file:
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(-1);
to show the errors and I got this:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/solomon/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 107
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes) in /var/www/solomon/vendor/symfony/debug/Exception/OutOfMemoryException.php on line 1
I'm not quite sure why this causes an error and unable to debug. var/log/prod.log
doesn't show anything, how do I resolve or better yet, how do I debug?
my prod/monolog.yaml file
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_404s:
# regex: exclude all 404 errors from the logs
- ^/
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine"]
this was auto-generated and I've made no changes
Check file permissions on symfony log files. It looks like monolog catches permission denied
exception, tries to write it to log and catches same error again and again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With