I have a programm which creates log files in web-server directory (/var/www/log). Every day it generates one new log file. I've set access permissions for this directory to 777
chmod 777 -R /var/www/log
But when system generates log file for new day, it doesn't have access permissions 777. I have to do it manually again. How can I correctly set permissions for directory? All files in this directory must have 777 automatically.