简体   繁体   中英

Symfony2 logging not working in production

In my symfony application when looking at the app/logs directory its completely empty and nothing seems to be logging on production however on my dev environment it works just fine.

in my /web/app.php file i have

$environments = array(
   'dev.url.com'         => 'dev',
   'produ.url.com'       => 'prod'
);

when looking at the /app/logs directory the folder is completely empty there isnt even a prod.log file however if i go into my /web/app.php file and change the value from prod to dev on the same server it starts to log everything just fine.

I do have a /app/config/config_prod.yml and a config_dev.yml

I cant figure out if there is a setting somewhere that is blocking this from working when the environment is set to prod? I have all the correct permissions on the directories as well too.

Permissions can often be the issue here - make sure write permissions are granted for both the web server (or PHP user - depending on your setup) - plus make sure if you have been running any console scripts from the commandline - then make sure that user can write too.

Also ensure that the cache directory has write enabled too.

There are additional setup hints in the great Symfony documentation.

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