View and filter logs
The azd app logs command provides powerful log viewing and filtering
capabilities for debugging and monitoring your services.
View All Logs
Stream logs from all local services:
azd app logs View Logs for a Specific Service
Focus on logs from one service:
azd app logs --service api Filter and Search Logs
Filter by Log Level
Show only errors:
azd app logs --level error Time Range
Show logs from the last hour:
azd app logs --since 1h Log Output Options
Follow Mode (Default)
Continuously stream new logs:
azd app logs --follow Show Timestamps
azd app logs --timestamps JSON Output
For programmatic parsing:
azd app logs --format json Try It Yourself
Run `azd app logs --service api` to view logs from just the API service. Try `--level error` to filter for errors.
Expected: You should see a filtered stream of logs from the specified service.
Combining Filters
You can combine multiple filters:
azd app logs --service api --level error --since 30m Export Logs
Save logs to a file for later analysis:
azd app logs --file logs.txt Dashboard Logs
The dashboard also provides a log viewer with filtering, search, and syntax highlighting. Access it via the Console tab.
Local vs Azure Logs
The dashboard supports viewing both local and Azure cloud logs in one unified interface. Use the mode toggle in the console toolbar to switch between:
- Local - Logs from locally running services
- Azure - Live logs from your deployed Azure services via Log Analytics
Azure Cloud Log Streaming
When you provision Azure services with azd provision or azd up,
the dashboard can stream logs from Container Apps, App Service, and Functions directly
into your local view with 1-5 minute latency. This lets you monitor both local and deployed services without switching tools.
Configuration: Add Azure Log Analytics settings in your azure.yaml:
logs:
analytics:
pollingInterval: 30s # Refresh interval
defaultTimespan: PT15M # Time range for queries
services:
web:
host: appservice
path: ./src/web
logs:
analytics:
table: AppServiceConsoleLogs Note: Azure Log Analytics has a typical ingestion delay of 1-5 minutes. Logs are not real-time but refresh automatically based on your polling interval.
Learn more in the Azure Cloud Log Streaming reference.