# Search logs

Search what your project's services wrote by service, level, time and message.

## Before you start

You need a project. See [Create a project](/docs/projects/create-project.md).

## Search logs

**Studio**

1. In your project, open **Observability** > **Logs**.
2. Open **Service**.
3. Pick one, such as **veryfront-api**. **Level** and the time range narrow the list too: the last 15 minutes, hour, 24 hours or 7 days.
4. Click the search icon.
5. Enter a word from the message, such as `Redis`.
6. Press Enter. You should now see only the lines that hold your word, such as `Subscribed to Redis channel`.

### Troubleshooting

**If Studio says "No logs match"**, widen the time range or click **Clear filters**. Search is case sensitive.

**API**

1. Set `PROJECT` to your project's ID ([Find your IDs](/docs/authentication/api-keys.md#find-your-ids)): `export PROJECT=<id>`.
2. Request the lines, with your [API key](/docs/authentication/api-keys.md). `limit` is at most 1000; add `start` and `end` for another window:

```bash
curl "https://api.veryfront.com/projects/$PROJECT/logs?search=Redis&limit=20" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY"
```

3. Read `data`. You should now see your word in every line's `message` or `metadata`.

### Try it in a sandbox

```playground
step: Set PROJECT | export PROJECT=$VERYFRONT_PROJECT_ID
step: Write a file, so the project has lines | curl -fsS -X PUT https://api.veryfront.com/projects/$PROJECT/files/tasks%2Fword-count.ts -H "Authorization: Bearer $VERYFRONT_API_KEY" -H "Content-Type: application/json" -d '{ "content": "export default { name: \"word-count\", async run() { return { words: 0 }; } };" }'
step: Wait for the lines | sleep 30
check: curl "https://api.veryfront.com/projects/$PROJECT/logs?search=Redis&limit=20" -H "Authorization: Bearer $VERYFRONT_API_KEY"
expect: Redis
```

## Export the lines

**Studio**

1. Open the **⋯** menu in the page's header.
2. Click **Export CSV**. You should now see a `logs-<project>-<time>.csv` file download.

## With MCP

1. Call `veryfront__list_project_logs` with `"project_reference": "my-project"` (your project's slug or ID), `"search": "Redis"` and `"limit": 20`. It worked when your word is in every line's `message` or `metadata`.

## Next steps

* [Debug a run](/docs/observability/debug.md)
* [See what a project costs](/docs/observability/project-analytics.md)
