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 in the Sidebar Menu:
You can find your App Logs in the Gear Menu:
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:
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 button, or search using a regular expression by clicking on the 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.
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.