> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Log export

> Push a function's runtime and invocation logs to an external OTLP endpoint as they happen.

Log export pushes a function's logs to an external endpoint over HTTPS as they happen, instead of only being readable with [`logs`](/docs/edge-compute/observability/logs). Logs are delivered in [OpenTelemetry OTLP](https://opentelemetry.io/docs/specs/otlp/) format, so any OTLP-compatible destination works: Honeycomb, Datadog, Grafana, or your own OpenTelemetry Collector.

## Requirements

> **Requires CLI v0.5.3 or newer.**

Log export is configured per function with the `log-export` command family. One function has at most one destination; setting a new one replaces the old one.

## Configure export

```bash theme={null}
telnyx-edge log-export set my-func --endpoint https://api.honeycomb.io/v1/logs --header x-honeycomb-team=abc123
```

`log-export set` is a **full replace, not a patch**: each call configures the destination from scratch, replacing any previous configuration for that function.

Which log types get exported follows the same presence convention as `logs --type`:

| Flags passed | What is exported |
| - | - |
| neither `--runtime` nor `--invocations` | both runtime and invocation logs (the default) |
| `--runtime` only | runtime logs only |
| `--invocations` only | invocation logs only |
| `--runtime` and `--invocations` together | each flag sets its type explicitly, e.g. `--runtime=false --invocations=true` |

| Flag | Description |
| - | - |
| `--endpoint` | HTTPS URL to push logs to (required). The value is the destination's OTLP endpoint URL. |
| `--header` | Header attached to every push, as `KEY=VALUE` (repeatable) — for example the auth token your collector expects. Encrypted at rest and never returned by any command, including `log-export get`. |
| `--runtime` | Export runtime logs (your code's `console.log`/error output) |
| `--invocations` | Export invocation logs (one record per HTTP request) |

## Inspect export configuration

```bash theme={null}
telnyx-edge log-export get my-func
```

Shows the configured destination endpoint and which log types are exported. Headers are never shown. With `--json`, the result is `{"configured": true, "data": {...}}`, or `{"configured": false, "data": null}` when nothing is configured.

## Stop exporting

```bash theme={null}
telnyx-edge log-export delete my-func
```

Stops exporting a function's logs. Idempotent: deleting when nothing is configured succeeds.

## How delivery works

* **Delivery is continuous and near-real-time.** Each new log line is converted to an OTLP log record and pushed as it happens — it is not a periodic batch or a one-time dump.
* **Export is a fan-out from storage, not a replacement for it.** Configuring export never stops logs from also being stored and readable with `logs`; a temporarily unreachable destination does not lose stored logs. Export retries with a bounded retry policy.
* **Runtime and invocation logs can both be exported** to the same destination, interleaved. Each record carries the function's identity so records route to the correct destination.
* **No history replay.** Export begins with logs generated after the destination is configured.

## Security notes

* The endpoint must be HTTPS.
* Header values (such as collector auth tokens) are encrypted at rest and never returned by the API or CLI.
* Export the minimum you need: invocation records contain request metadata (method, path, status, sizes, region), and runtime logs contain whatever your code prints. Do not log sensitive payloads.

See the [CLI reference](/docs/edge-compute/reference/cli#log-export) for the full command reference.
