TypeScript
---
title: logs
description: Fetch or tail logs from deployed resources, merged and color-coded by resource.
---
```sh
alchemy logs [options]
```
Fetch historical logs from deployed resources, or pass `--tail` to stream
new entries until interrupted.
Entries from all resources are merged and sorted by timestamp, color-coded by resource.
`--resource` accepts comma-separated logical IDs. Values are validated against
the stack. An unknown ID fails the command and lists the available IDs.
Resources must be deployed and their provider must implement log fetching; if none qualify, the command prints `No resources with logs found. Deploy first, then run logs.` and exits.
## Flags
| Option | Description |
| ------------------- | ---------------------------------------------------------------------------------------------- |
| `--stage <name>` | Stage to fetch logs from (defaults to `$ALCHEMY_STAGE` or `live_$USER`) |
| `--resource, -r <ids>` | Comma-separated logical resource IDs to include, such as `Worker,Api` |
| `--limit <n>` | Number of log entries to fetch (default: 100) |
| `--since <time>` | Fetch logs since this time — a duration (`30m`, `1h`, `2d`; units `s`/`m`/`h`/`d`) or ISO date |
| `--tail`, `-t` | Continue streaming new log entries |
| `--profile <name>` | Auth profile to use (defaults to `$ALCHEMY_PROFILE` or `default`) |
| `--env-file <path>` | Load environment variables from a file |
| `--config <path>` | Stack file to read logs for (defaults to `alchemy.run.ts`) |
## Examples
```sh
# Last 50 log entries from all resources
alchemy logs --limit 50
# Logs from the last hour for Worker and Api
alchemy logs --resource Worker,Api --since 1h
# Tail Worker and Api in real time
alchemy logs --tail --resource Worker,Api
# Logs from a specific stage since a date
alchemy logs --stage prod --since 2026-04-01T00:00:00Z
```
## Where next
- [dev](/cli/dev) — run your stack with hot reloading
- [cloudflare](/cli/cloudflare) — inspect the state-store worker's own logs