# pier logs

> Read or follow logs for an app, a Postgres, or the whole environment

URL: https://pier.run/docs/cli/reference/logs

```bash
pier logs [<ref>] [flags]
```

Read or follow logs for an app, a Postgres, or the whole environment.

## Arguments

| Argument | Required | Description                                                                        |
| -------- | -------- | ---------------------------------------------------------------------------------- |
| `<ref>`  | no       | App or Postgres to read (name, name/target, or name/target/instance); omit to pick |

## Flags

| Flag             | Value       | Default | Description                                                                                                                  |
| ---------------- | ----------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `--type`         | `STRING`    |         | Disambiguate a name shared by several kinds: app or pg                                                                       |
| `--all`          |             |         | Every app in the environment (skips the picker)                                                                              |
| `--tail`         | `100`       | `100`   | Max lines                                                                                                                    |
| `--since`        |             | `1h`    | Lookback: a duration (30m, 6h, 7d) or an RFC3339 time                                                                        |
| `--query`        | `STRING`    |         | Search filter (Quickwit syntax; a bare word matches the message; substring-only with --follow)                               |
| `--level`        | `LEVEL,...` |         | Only these levels (repeatable). Apps: INFO WARN ERROR FATAL DEBUG TRACE; Postgres: LOG INFO NOTICE WARNING ERROR FATAL DEBUG |
| `--instance`     | `STRING`    |         | Apps: one instance (name or pod suffix) — the same as a third ref segment                                                    |
| `-f`, `--follow` |             |         | Keep streaming new lines until Ctrl-C (apps and environments)                                                                |
| `--utc`          |             |         | Timestamps in UTC instead of local time                                                                                      |

[Global flags](/docs/cli/reference#global-flags) apply to every command.
