# Azion CLI logs

The Azion CLI `logs` commands print recent logs in the terminal. `azion logs cells` shows the console logs of your [functions](/en/documentation/platform/functions/), and `azion logs http` shows the HTTP event logs of your [applications](/en/documentation/platform/applications/). The options every command accepts, such as `--debug`, `--timeout`, and `-c`, are on [Global options](/en/documentation/devtools/cli/globals/).

---

## Usage

`azion logs` takes the kind of log as a subcommand, `cells` or `http`:

```bash
azion logs [flags]
```

The command takes no flags of its own. `-h` or `--help` prints the help of the command, and `azion logs <subcommand> --help` prints the help of one subcommand.

---

## azion logs cells

`azion logs cells` shows the console logs that your functions write. `cells` is the name the CLI gives to function console logs. The command returns the logs of the last 5 minutes:

```bash
azion logs cells [flags]
```

| Flag            | Short | Type   | Default | Description                                                                                                                        |
| --------------- | ----- | ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `--function-id` | —     | string | —       | ID of the function whose logs you want. Without it, the command shows the logs of every function.                                  |
| `--limit`       | —     | string | `"100"` | Number of log entries the command shows at a time.                                                                                 |
| `--pretty`      | —     | —      | —       | Prints the logs in a formatted layout.                                                                                             |
| `--tail`        | —     | —      | —       | Keeps the command running and prints logs as they arrive, like `tail -f`. Between logs, it prints `Waiting for the next event...`. |

To find the ID of a function, refer to [Azion CLI function](/en/documentation/devtools/cli/resources/function/).

---

## azion logs http

`azion logs http` shows the HTTP event logs of your applications, one entry per request, oldest first. The command returns the logs of the last 5 minutes:

```bash
azion logs http [flags]
```

| Flag       | Short | Type   | Default | Description                                                                                                                        |
| ---------- | ----- | ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `--limit`  | —     | string | `"100"` | Number of log entries the command shows at a time.                                                                                 |
| `--pretty` | —     | —      | —       | Prints each field of an entry on its own line.                                                                                     |
| `--tail`   | —     | —      | —       | Keeps the command running and prints logs as they arrive, like `tail -f`. Between logs, it prints `Waiting for the next event...`. |

Each entry carries the timestamp, host, request URI, status, user agent, region name, bytes sent, request time, and request method of one request.

---

## Examples

These examples read the HTTP event logs of an application that serves a static site.

### Show HTTP event logs

This command shows five HTTP event logs:

```bash
azion logs http --limit 5
```

The command prints one line per request:

```text
Timestamp: 2026-01-01 12:00:00 +0000 UTC, Host: xxxxxxxxxx.map.azionedge.net, Request URI: /, Status: 200, User Agent: curl/8.7.1, Region Name: <region-name>, Bytes Sent: 692, Request Time: 0.445, Request Method: GET

Timestamp: 2026-01-01 12:00:02 +0000 UTC, Host: xxxxxxxxxx.map.azionedge.net, Request URI: /, Status: 200, User Agent: curl/8.7.1, Region Name: <region-name>, Bytes Sent: 692, Request Time: 0.392, Request Method: GET

Timestamp: 2026-01-01 12:00:02 +0000 UTC, Host: xxxxxxxxxx.map.azionedge.net, Request URI: /about.html, Status: 200, User Agent: curl/8.7.1, Region Name: <region-name>, Bytes Sent: 692, Request Time: 1.056, Request Method: GET

Timestamp: 2026-01-01 12:00:02 +0000 UTC, Host: xxxxxxxxxx.map.azionedge.net, Request URI: /about, Status: 204, User Agent: curl/8.7.1, Region Name: <region-name>, Bytes Sent: 0, Request Time: 0, Request Method: GET

Timestamp: 2026-01-01 12:00:57 +0000 UTC, Host: xxxxxxxxxx.map.azionedge.net, Request URI: /, Status: 200, User Agent: curl/8.7.1, Region Name: <region-name>, Bytes Sent: 692, Request Time: 0.614, Request Method: GET
```

### Show HTTP event logs field by field

This command shows two HTTP event logs in the readable layout:

```bash
azion logs http --limit 2 --pretty
```

The command prints each field on its own line, with a blank line between requests:

```text
Timestamp: 2026-01-01 12:00:00 +0000 UTC
Host: xxxxxxxxxx.map.azionedge.net
Request URI: /
Status: 200
User Agent: curl/8.7.1
Bytes Sent: 692
Request Time: 0.445
Request Method: GET
Region Name: <region-name>

Timestamp: 2026-01-01 12:00:02 +0000 UTC
Host: xxxxxxxxxx.map.azionedge.net
Request URI: /
Status: 200
User Agent: curl/8.7.1
Bytes Sent: 692
Request Time: 0.392
Request Method: GET
Region Name: <region-name>
```

### Follow HTTP event logs as they arrive

This command prints the HTTP event logs of the last 5 minutes and keeps running:

```bash
azion logs http --tail
```

While no request arrives, the command prints `Waiting for the next event...`. Each new request appears when it is logged, and the command runs until you stop it:

```text
Timestamp: 2026-01-01 12:00:02 +0000 UTC, Host: xxxxxxxxxx.map.azionedge.net, Request URI: /, Status: 200, User Agent: curl/8.7.1, Region Name: <region-name>, Bytes Sent: 692, Request Time: 0.392, Request Method: GET

Timestamp: 2026-01-01 12:00:02 +0000 UTC, Host: xxxxxxxxxx.map.azionedge.net, Request URI: /about.html, Status: 200, User Agent: curl/8.7.1, Region Name: <region-name>, Bytes Sent: 692, Request Time: 1.056, Request Method: GET

Timestamp: 2026-01-01 12:00:02 +0000 UTC, Host: xxxxxxxxxx.map.azionedge.net, Request URI: /about, Status: 204, User Agent: curl/8.7.1, Region Name: <region-name>, Bytes Sent: 0, Request Time: 0, Request Method: GET

Timestamp: 2026-01-01 12:00:57 +0000 UTC, Host: xxxxxxxxxx.map.azionedge.net, Request URI: /, Status: 200, User Agent: curl/8.7.1, Region Name: <region-name>, Bytes Sent: 692, Request Time: 0.614, Request Method: GET

Timestamp: 2026-01-01 12:01:57 +0000 UTC, Host: xxxxxxxxxx.map.azionedge.net, Request URI: /, Status: 200, User Agent: curl/8.7.1, Region Name: <region-name>, Bytes Sent: 692, Request Time: 0.466, Request Method: GET

Timestamp: 2026-01-01 12:02:50 +0000 UTC, Host: xxxxxxxxxx.map.azionedge.net, Request URI: /, Status: 200, User Agent: curl/8.7.1, Region Name: <region-name>, Bytes Sent: 692, Request Time: 0.444, Request Method: GET

Timestamp: 2026-01-01 12:03:41 +0000 UTC, Host: xxxxxxxxxx.map.azionedge.net, Request URI: /, Status: 200, User Agent: curl/8.7.1, Region Name: <region-name>, Bytes Sent: 692, Request Time: 0.478, Request Method: GET

Waiting for the next event...

Waiting for the next event...

Waiting for the next event...

Timestamp: 2026-01-01 12:04:42 +0000 UTC, Host: xxxxxxxxxx.map.azionedge.net, Request URI: /, Status: 200, User Agent: curl/8.7.1, Region Name: <region-name>, Bytes Sent: 692, Request Time: 0.413, Request Method: GET

Waiting for the next event...
```

---

## Related resources

- [Global options](/en/documentation/devtools/cli/globals.md): The options every command accepts, such as `--debug`, `--timeout`, and `-c`.
- [Azion CLI function](/en/documentation/devtools/cli/resources/function.md): The commands that list your functions and print the ID that `--function-id` takes.
- [Real-Time Events](/en/documentation/platform/real-time-events.md): Where Azion keeps the event records your products write, searchable in Azion Console and through a GraphQL API.
- [Azion CLI deploy](/en/documentation/devtools/cli/deploy.md): The command that deploys a project to an application, whose requests `azion logs http` then shows.
