You are currently viewing the new Anvil Editor Docs.
Switch to the Classic Editor Docs
You are currently viewing the Classic Editor Docs.
Switch to the new Anvil Editor Docs

App Logs

All print()ed output from your apps is captured in the Anvil App Logs. Every session starts a new entry in the logs, and Exceptions are also recorded here.

You can find your App Logs Logs Icon in the Sidebar Menu:

Select App Logs… from the Sidebar Menu

Select App Logs… from the Sidebar Menu

You can find your App Logs in the Gear Menu:

Select App Logs… from the Gear Menu

Select App Logs… from the Gear Menu

App logs are retained for 7 days on the Free and Hobby plans, and 90 days on the Business Plan and higher.

The App Logs Dialog

Output from the client and server is visually distinct - server output has a yellow background, just like in the Output Panel. And just like in the Output Panel, you can click Exception tracebacks to jump to the place in the code where the error occurred:

Output from the client and server is visually distinct - server output has an orange border on its left-hand margin, just like in the Output Panel. And just like in the Output Panel, you can click Exception tracebacks to jump to the place in the code where the error occurred:

The App Logs dialog

The App Logs dialog

Searching and filtering

You can search for specific logs by using the Search Bar at the top. You can make this search case-sensitive by clicking on the Case Case button, or search using a regular expression by clicking on the RegEx regex button. You can also search for a session by its Session ID. In a running app, you can get the ID of the current session by calling anvil.server.get_session_id().

Logs can be filtered by Session Types (Browser, HTTP, Background Task, Email or Uplink) and by Environment, using the dropdowns under the Search Bar.

The App Logs dialog

The App Logs dialog

There is a 150 line limit on the number of logs that are stored per session.

Sessions

Debug sessions are marked so you can tell whether a session was initiated by you, in the Anvil Editor, or by someone visiting your app for real.

Incoming emails and requests to HTTP endpoints both create new sessions that will be visible in the App Logs.


Do you still have questions?

Our Community Forum is full of helpful information and Anvil experts.