Tail -f app.logs?

What I’m trying to do:
Is there any way (at a bash prompt) to access my application logs when running http_endpoints?
I know I can get them via the “App Logs…” menu option but was looking for something at the bash level so I can leave a terminal session running something like ‘tail -f someapp.anvil.app/XXXX/myapp.log’

No, there is no way to check the log of an app from a dashboard or from the outside world.

You can get the link to the log of one session, but each http endpoint call creates a new session.

The logging system has been redesigned recently, and I think we will have APIs to interact with the logs, hopefully they will come soon.

In the mean time I have my http endpoints logging to a datatable and I have an app that shows me the logs. In one logger app I have logs from mutliple Anvil apps and other tools, so I can filter the sessions and keep an eye on the activity.

Here is an FR that I posted some time back: Dashboard that allows checking all the logs of all the apps

PS: Welcome to the forum!

@stefano.menci Thanks for the tips - I will try your suggestion, although that will still leave fixing syntax errors etc via the log viewer.

I agree, if you do the logging after a crash, you don’t log the crash, and the logging itself could fail.

I wrap most http endpoint in a try-except and log or email myself the traceback when there is an error. Here I describe how I do that in an uplink: How to handle unexpected disconnect in Uplink program? - #4 by stefano.menci

Anvil allows also to define a default error handler, but I have never tried it with http endpoints.

3 Likes