Piddien
Piddien

Reputation: 1446

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

Upvotes: 4

Views: 7150

Answers (1)

hanzi
hanzi

Reputation: 2987

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.

Upvotes: 6

Related Questions