When developing apps with the App SDK, debugging is essential for understanding your app’s behavior and fixing issues. You can log messages both in your frontend code and server functions.

Logging

The App SDK supports standard console methods that work in both frontend and server environments:
  • console.log() - For general information and debugging output
  • console.warn() - For warnings that don’t break functionality but need attention
  • console.error() - For unexpected errors that break functionality for your app’s users
// Works in both frontend components and server functions
console.log("Server function started")
console.warn("User not found")
console.error("Failed to connect to external API:", error.message)
These logs will appear in different places depending on where they’re called from. Let’s explore where to find your logs.

Frontend logs

Frontend logs appear in your browser’s console. To access them, open the dev tools of your browser and navigate to the Console tab.

Server logs via Developer Portal

The Developer Portal provides a comprehensive logs viewer for your app’s server functions across all workspaces where your app is installed. This is the primary way to monitor your app in production. How to access:
  1. Navigate to the Developer Portal
  2. Select your app
  3. Click on the Logs tab
You can only view the logs for one workspace at a time. To get started, enter the workspace’s slug to select it.

Development server logs via CLI

For your development build, you can stream logs directly to your terminal using the Attio CLI. This provides a real-time view of your development logs to debug your app while you’re building it. How to access: Run the following command:
npx attio logs
You can optionally specify a workspace:
npx attio logs --workspace your-workspace-slug
Example output:
2024-01-15T10:30:45.123Z INFO: Server function started
2024-01-15T10:30:45.234Z WARNING: User not found
2024-01-15T10:30:45.302Z ERROR: Failed to connect to external API: Connection timeout