Log exports

Logs sent on to a bucket, S3, HTTP, OpenTelemetry or Grafana Loki.

Overview

A log export sends your apps’ and services’ logs somewhere else as they happen, so you can keep them longer or search them in a tool you already use.

When to use it

  • Keep logs longer than the machine does.
  • Search all logs in one place.
  • A copy for audits.

How it works

Shipper
Follows every container of each source from the engine’s logs, with a checkpoint per container.
Destinations
A bucket (gzip files of JSON lines), any S3, HTTP, OpenTelemetry (OTLP/HTTP) or Grafana Loki.

A batch is recorded as sent only once the destination accepts it, so lines arrive at least once. If the engine rotated lines away before they were sent, the export records the gap.

Architecture

Log exports architectureThe shipper follows container logs and sends batches on.log linesbatchesContainersevery replicaShippercheckpointsBucket, S3, HTTP, OTLP or Loki
The shipper follows container logs and sends batches on.
  • Containers to Shipper: log lines
  • Shipper to Bucket, S3, HTTP, OTLP or Loki: batches

Flows

Exporting to a bucket

  1. Create the export with a bucket folder.
  2. Every minute a compressed file of new lines arrives.
  3. The page shows lines sent and any error.

Set it up

In the console

  1. Open Log exports and choose New log export.
  2. Choose where logs go and which resources.
  3. Add a filter if you want only some lines.

With the CLI

enclave logexport create archive --bucket uploads/logs --wait

With OpenTofu

OpenTofu configuration
resource "enclave_log_export" "archive" {
  name   = "archive"
  bucket = { bucket = "uploads", prefix = "logs" }
}

Settings reference

Every setting and output of the OpenTofu resource; the console and the CLI use the same names in their own words. Generated from platform 4d30582.

enclave_log_export
NameTypeUseWhat it does
nametextrequiredName of the log export: 3–40 lowercase letters, digits or hyphens, starting with a letter. Changing it replaces the log export.
bucketlist of objectsoptionalA bucket of the project: gzip files of JSON lines.
filtertextoptionalOnly lines matching this regular expression are sent.
flush_secondsnumberoptionalHow often batches go (5–300; default 10, or 60 for buckets).
httplist of objectsoptionalJSON lines POSTed to a URL.
lokilist of objectsoptionalGrafana Loki's push API.
otlplist of objectsoptionalAn OpenTelemetry (OTLP/HTTP) logs endpoint.
projecttextoptionalThe project to create it in. Defaults to the provider's project (ENCLAVE_PROJECT, else default). Changing it replaces the resource.
s3list of objectsoptionalAny S3-compatible bucket.
sourceslist of textoptionalResources as "kind/name" (default every resource of the project with logs).
idtextoutputResource ID.
last_sent_attextoutputWhen a batch last went.
lines_sentnumberoutputLines sent so far (refreshed on read).

Limits and security

Good to know

  • Batches every 10 seconds (60 for buckets) unless you choose.

Security

  • Secrets never appear in logs, so never in exports; headers for destinations come from a secret.