I was trying to follow the flask error handling tutorial - http://flask.pocoo.org/docs/errorhandling/#logging-to-a-file.
When I try to create the handler I am getting error
[Errno 13] Permission denied: '/var/www/FlaskTest/FlaskTest/store.log'
I just want to log some data to a file for further analysis. What is the easiest way to do this?
EDIT:
Adding some more info: I am running the web application through the wsgi packaging and serving through apache. I understand user roles and need to grant permission :
logfile = logging.FileHandler("/var/www/FlaskTest/FlaskTest/store.log")
As you see I have tried targeting the www directory, should I be targeting another directory? I also don't want to expose the application by giving it unnecessary permissions. Is there a simple way to write objects to a file for later analysis in flask?
/var/www/FlaskTest/FlaskTest, or it does not have the permissions to write to the file/var/www/FlaskTest/FlaskTest/store.log.