# Stream a project's logs live

`GET /v1/projects/{project_id}/tail`

Requires role member or higher.

Server-Sent Events with the project's redacted log lines as they arrive. Nothing is stored and nothing before the request is sent; a line can occasionally be missing or repeated.

Events: `lines` (data: an array of TailLine), `dropped` (data: TailDropped, at most once per second), `end` (data: TailEnd, then the server closes). A `: ping` comment is sent every 15 seconds.

Limits come from the plan: concurrent sessions per organization (`403 plan-limit-reached` with `limit: "tail_sessions"`), lines per second per session and session duration.

## Authentication

A session token: `Authorization: Bearer <session token>`, or the session cookie in the browser. Requires role `member` or higher.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `project_id` | path | string | yes |  |
| `service` | query | string | no | Only this service (exact match). |
| `environment` | query | string | no | Only this environment (exact match). |
| `level` | query | string | no | Minimum level; default info. |
| `q` | query | string | no | Case-insensitive text the message contains; not a pattern. |

## Responses

### 200

An event stream (lines, dropped, end).

`text/event-stream`

### 401

unauthorized: no valid session, or the email is not verified.

Problem type: [unauthorized](https://docs.dlogify.com/errors/unauthorized.md).

### 403

plan-limit-reached: the plan's tail_sessions limit is reached.

Problem type: [plan-limit-reached](https://docs.dlogify.com/errors/plan-limit-reached.md).

### 404

not-found: the resource does not exist, or the caller is not a member of its organization.

Problem type: [not-found](https://docs.dlogify.com/errors/not-found.md).

### 422

validation-failed: the request does not match the schema.

Problem type: [validation-failed](https://docs.dlogify.com/errors/validation-failed.md).

### 429

rate-limited: per-user management request limit.

Problem type: [rate-limited](https://docs.dlogify.com/errors/rate-limited.md).

### 503

tail-unavailable: the message bus behind live tail is not available.

Problem type: [tail-unavailable](https://docs.dlogify.com/errors/tail-unavailable.md).

## Example

```bash
curl -X GET "https://api.dlogify.com/v1/projects/{project_id}/tail" \
  -H "Authorization: Bearer $DLOGIFY_SESSION"
```

Source: https://docs.dlogify.com/api/live-tail/tailProject
