# Logs

Send OpenTelemetry logs to Altertable when you want application log records to be queryable beside product, operational, and business data.

Accepted log records are written to `opentelemetry.main.logs`.

| Table                     | Description                                                                          |
| ------------------------- | ------------------------------------------------------------------------------------ |
| `opentelemetry.main.logs` | Log records with severity, body, trace/span IDs, attributes, and resource attributes |

## Endpoint

Send OTLP/HTTP protobuf logs to:

```text
POST https://api.altertable.ai/v1/logs
```

Use `Content-Type: application/x-protobuf` and authenticate with the same HTTP Basic Auth credentials used by the [Lakehouse API](/docs/api-references/lakehouse.md).

```bash
curl https://api.altertable.ai/v1/logs \
  -H "Authorization: Basic $ALTERTABLE_BASIC_AUTH_TOKEN" \
  -H "Content-Type: application/x-protobuf" \
  --data-binary @logs.pb
```

## SDK and collector setup

Use the standard OpenTelemetry SDK for your application language and configure its OTLP/HTTP exporter to send logs to Altertable. The SDK handles instrumentation, batching, resource attributes, and protobuf encoding.

See the [OpenTelemetry SDK documentation](https://opentelemetry.io/docs/languages/) for language-specific setup guides.

## Query logs

Logs are normal SQL rows once they are ingested:

```sql
SELECT
  timestamp,
  severity_text,
  body,
  trace_id,
  span_id
FROM opentelemetry.main.logs
ORDER BY timestamp DESC
LIMIT 100;
```

You can also explore logs in the Altertable Explore tab with Lucene-syntax search.