简体   繁体   中英

Symfony2 not logging in prod

I am using Symfony 2. I have gone through all of the installation with configuring parameters.yml and running composer install and following the guide on http://symfony.com/doc/current/cookbook/deployment-tools.html

I have only a blank page when I enter my adress online, and the log files in app/logs is not written to. I have run the command sudo chgrp apache app/logs and chmod g+w /app/logs to make the folder writable but no success

under config_prod.yml:

monolog:
handlers:
    main:
        type:         fingers_crossed
        action_level: warning
        handler:      nested
    nested:
        type:  stream
        path:  "%kernel.logs_dir%/%kernel.environment%.log"
        level: debug

A white page usually means that an error occurred before the Symfony environment (which includes the logger) is even loaded. That's probably why there's nothing written to the log. If Symfony were running, you would probably see the default 'error 500' message.

So what you should be actually looking for is a PHP error. Production environments offen suppress error messages by disabling display_errors in their php.ini . You could either enable this temporarily in order to see the errors directly on the erroneous page or -- even better -- log in the error log of your web server. PHP error messages should appear there as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM