How to clear logs on pythonanywhere?

25 Views Asked by At

I've deployed my first Flask app on pythonanywhere.com. It's the perfect environment for me. My first few attempts weren't too successful so the error logs are full of helpful hints. Now that my app is up, though, I'd like to clear the logs so that I won't have to sift through irrelevant information the next time erros occur (there will be updates). I don't see how to do that and have checked here but couldn't find the answer in previous posts. Thanks.

1

There are 1 best solutions below

0
Giles Thomas On

A quick and easy way to do that is to overwrite the current contents with an empty string from a Bash console. Let's say that the log you want to clear is /var/log/someusername.pythonanywhere.com.error.log -- with that you would run this command:

echo > /var/log/someusername.pythonanywhere.com.error.log