Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/doc/ai-llms.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ A throwaway environment and a production one differ by their plan, not by their
An agent reads all of it through the same CLI it used to deploy:

```bash
clever logs --since 10m
clever logs --since 10m --until now
clever activity
clever status
```
Expand Down
9 changes: 6 additions & 3 deletions content/doc/develop/observability/access-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ You can see access logs with the following command:
clever accesslogs
```

As with the `logs` command, you can specify `--before` and `--after` flags.
If you don't specify any options, the logs display continuously.
As with the `logs` command, you can specify `--since` and `--until`. Without `--until`, the command keeps following new requests, even with `--since`. Set `--until` to stop at a given end time and get the prompt back, and add `--since` to choose where to start. Use `--until now` to read up to the current time:

```bash
clever accesslogs --since 15m --until now
```

To change the output, specify the `--format` (`-F`) flag with one of these values:

Expand All @@ -44,7 +47,7 @@ To change the output, specify the `--format` (`-F`) flag with one of these value

The HTTP protocol version isn't part of the access log payload, so the request line is limited to `method path` (no `HTTP/x.y` token).

- `json`: a JSON array of log objects (requires a bounding flag such as `--before`)
- `json`: a JSON array of log objects (requires a bounding flag such as `--until`)
- `json-stream`: a stream of JSON log objects

Both JSON formats share the same object shape:
Expand Down
7 changes: 7 additions & 0 deletions content/doc/develop/observability/logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ clever logs --since 2h
clever logs --until 2024-04-15T13:37:42Z
```

Without `--until`, `clever logs` keeps following new lines after printing the past ones, even with `--since`. Set `--until` to stop at a given end time and get the prompt back, as a script or an AI agent needs, and add `--since` to choose where to start. Use `--until now` to read up to the current time. The `json` output format requires `--until`:

```bash
clever logs --since 15m --until now
clever logs --since 15m --until now --format json
```

You can also get your add-on's logs by using `--addon` flag, the value is the add-on ID starting by `addon_`, or its real ID:

```bash
Expand Down
15 changes: 9 additions & 6 deletions content/doc/manage/cli/applications/deployment-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@
clever ssh --instance INSTANCE_ID
```

`clever instances` lists the running instances of your application by default. Add `--all` to list instances in any state, including deleted ones. Filter them by period with `--after` and `--before`, which select the instances that existed during that period, or by deployment with `--deployment-id`: these filters also include past instances. The command lists the 100 most recent matching instances by default, use `--limit` to get up to 1,000:
`clever instances` lists the running instances of your application by default. Add `--all` to list instances in any state, including deleted ones. Filter them by period with `--since` and `--until`, which select the instances that existed during that period, or by deployment with `--deployment-id`: these filters also include past instances. The command lists the 100 most recent matching instances by default, use `--limit` to get up to 1,000:

Check warning on line 124 in content/doc/manage/cli/applications/deployment-lifecycle.md

View workflow job for this annotation

GitHub Actions / Run Vale Linter

[vale] reported by reviewdog 🐢 [Google.WordListCase] Use 'app' instead of 'application'. Raw Output: {"message":"[Google.WordListCase] Use 'app' instead of 'application'.","location":{"path":"content/doc/manage/cli/applications/deployment-lifecycle.md","range":{"start":{"line":124,"column":56},"end":{"line":124,"column":67}}},"severity":"WARNING","code":{"value":"Google.WordListCase","url":"https://developers.google.com/style/word-list"}}

```console
clever instances --all
clever instances --after 1d --format json
clever instances --since 1d --format json
```

To execute a single command on the remote instance and exit, use `--command` (`-c`). Clever Tools runs it in `bash` when the instance provides it, in `/bin/sh` otherwise. Its output streams to your terminal without the SSH gateway messages, so you can use it in scripts:
Expand Down Expand Up @@ -159,6 +159,12 @@
[--format, -F] FORMAT Output format (human, json, json-stream) (default: human)
```

By default, logs keep streaming. Use `--until` to set an end time. To read the last 15 minutes and exit, use:

```console
clever logs --since 15m --until now
```

## access logs

When you deploy an application on Clever Cloud, we collect its access logs, hosted in our internal Pulsar stack, all included. To listen to the stream, use:
Expand All @@ -167,9 +173,6 @@
clever accesslogs
```

> [!TIP]
> This now uses our v4 API, it's available as Alpha feature for now.

You can also get access logs from a specific timeline through options, in multiple formats:

```text
Expand All @@ -180,7 +183,7 @@

Besides HTTP requests, access logs include TCP redirections and SSH connections to your instances. In the `human` format, a column shows the transport of each line, `HTTP`, `TCP` or `SSH`, and HTTP methods and paths get their own columns so they stay aligned. The `clf` format, for Common Log Format, only outputs HTTP access logs.

You can for example get access logs in JSON stream format for the last hour with:
You can for example follow access logs in JSON stream format, starting from the last hour, with:

```console
clever accesslogs --format json-stream --since 1h
Expand Down
Loading