Hello,
I'm new to PythonAnywhere and I try to test a simple Flask web app. The app works well but I can't get RotatingFileHandler working well. It does work when I launch it on my local machine but once on PythonAnywhere, no logs are written into the specified file.
Here is the snippet of code regarding the RotatingFileHandler :
formatter = Formatter('%(asctime)s %(levelname)s: %(message)s '
'[in %(pathname)s:%(lineno)d]')
prod_file_handler = RotatingFileHandler('test.log', maxBytes=10000000, backupCount=3)
prod_file_handler.setFormatter(formatter)
prod_file_handler.setLevel(logging.INFO)
app.logger.addHandler(prod_file_handler)
app.logger.setLevel(logging.INFO)
I checked the permission rights on the file 'test.log' (and even tried chmod 777) but no result. Can you please help me :-( ? Thank you