I am using the default logger in Django in
logging.info('Staring execution. Models for db tables')
500 Internal Server error
It's problem related with
SELinux. If You run locally, then You have full rights to write to log file.
If You run server with apache, then apache must have full rights to write to file.
To check it, login as apache
sudo su - apache and try to access to log file.
Solution is simple: put log file in
/var/log folder. Or create
/var/log/myapp folder and give it full access
chmod 777 /var/log/myapp.
import logging logging.basicConfig(filename='/var/log/myapp/models.log',level=logging.INFO) logging.info('Staring execution. Models for db tables')