motion.log permission denied

Problem:
You try to setup Motion with the option to write the application log into motio-log file, you can do this edition the motion.config file and you can select the path to the file log.
That happens on the standard configuration also if you try to setup motion as a service.
Beside this, you get the error message "motion.log permission denied"

Solution:
The problem is all due to files and folders permissions, if you run motion as a service the system will run motion as a root user, not pi user.
Change files and system folders using chmod