permission issue on sugar log file (644)

Hello Team,

We are getting permission denied error on the default SugarCRM logfile. Whenever it creates a new log file with rw-r--r-- (644) access.

Every time, we require to change 777 permission on the log file. Please let us know how to fix it so that by default it set to 777.

Thanks!

Regards,

Pavan

  • Hi Pavan,

    Please go through these Tips for managing Sugar Permissions and Configuring File Permissions to get some idea.

    Hope this information will be helpful.

    Thanks,

    Poojitha.K

  • Check include/SugarLogger/SugarLogger.php - Sugar will create the file using touch , resulting in default 644 permissions.

    @touch($this->full_log_file);

    If you want alter permissions, you may want to extend logger and add a chmod to set 777 permissions.

    For some reason, this doesn't follow the permissions as mentioned in the documentation, it's directly using @touch

  • For what it's worth, 664 should be good enough for the log file, 777 is a bit extreme :)

    My permissions panacea is to run these from sugar root (and sometimes other directories), they respectively: set ownership and group on every file and directory, from where you are down, to apache; set all directories to 775, and set all files to 664.

    I run these after every upgrade or any time I suspect permission issues. 

    Fullscreen
    1
    2
    3
    4
    5
    sudo chown -R apache:apache *
    sudo find . -type d -exec chmod 775 {} \;
    sudo find . -type f -exec chmod 664 {} \;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX