Forums

How to monitor server activity in a console instead of in logs

I've deployed a Bottle-based Python web app.

In my app, I issue print statements for debugging, and I would like to receive those print statements as they're executed inside the console I have open in the editor here on pythonanywhere--I assume that's why you have the ability to open a console window inside the editor.

How do I get the print statements inside the live console instead of everything being piped into the three separate log files?

You can't run a web app from a console on PythonAnywhere. You can put some additional logging and redirect it to a custom file (e.g. by using Python logging library), but you will always need to look at some file to see the logs. You can do it in a Bash console, using tail command, which allows to see how files are being updated (you can watch several files at a time). The usual logs for your web app are located at /var/log. The only constraint here would be that if your web app would produce too much logs in a short time, the console could be automatically killed.

Thank you for the tail tip. I'll look into that and how to produce my own logs.

Let us know if you have any extra questions.