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

# Logs

> Choose how much your agent logs with log_level, read logs per session on the Dashboard, and export them to Datadog, SigNoz, New Relic, or any OpenTelemetry backend.

Your agent writes log records while it runs a session: what it's doing, warnings, and errors. You control how much it logs with `log_level`, read the logs of any session on the Dashboard, and can ship them to your own observability stack.

## Set the log level

Set `log_level` on the room's `Observability` to choose which records the agent emits. The agent logs records at that level and above.

```python title="Python" Python theme={null}
from zeroruntime import Observability, Room

room = Room(
    observability=Observability(
        log_level="INFO",
    ),
)
```

```typescript title="Node JS" Node JS theme={null}
import { Observability, Room } from '@zeroruntime/js-sdk';

const room = Room({
  observability: Observability({
    log_level: 'INFO',
  }),
});
```

| Level | Logs |
| - | - |
| `DEBUG` | Everything, including detailed internal steps. Use it while developing. |
| `INFO` | Normal activity, warnings, and errors. This is the default. |
| `WARNING` | Warnings and errors only. |
| `ERROR` | Errors only. |
| `CRITICAL` | Critical errors only. |

## View logs on the Dashboard

Every session's logs are kept on the Zero Runtime Dashboard. Open **Sessions**, click **Actions > View** on a session, then select the **Logs** tab. Logs are listed newest first.

| Column | Shows |
| - | - |
| `Timestamp` | When the record was written. |
| `Level` | The record's level, such as `Info` or `Error`. |
| `Logger` | The component that wrote the record, such as the metrics collector or the pipeline orchestrator. |
| `Message` | The log message. |

Use **Showing** at the bottom of the table to set how many records appear on a page, and **Previous** and **Next** to page through the rest. Only records at or above the session's `log_level` appear here.

![Session view on the Zero Runtime Dashboard with the Logs tab selected, showing a table of log records with Timestamp, Level, Logger, and Message columns, and pagination controls below](https://cdn.zeroruntime.ai/zrt/docs-resource/analytics-logs.png)

The Logs tab of the Session view, listing each record's timestamp, level, logger, and message

## Export logs to your observability stack

To send logs to your own observability stack, such as Datadog, SigNoz, or New Relic, set `logs` on the room's `Observability` to an `Exporter` that points at your collector's OpenTelemetry (OTLP) endpoint. `log_level` applies to exported logs too.

```python title="Python" Python theme={null}
import zeroruntime
from zeroruntime import Exporter, Observability, Room

if __name__ == "__main__":
    zeroruntime.serve(
        MyVoiceAgent,
        room=Room(
            name="Logs Agent",
            observability=Observability(
                logs=Exporter(
                    enabled=True,
                    export_url="https://otel-collector.example.com/v1/logs",
                ),
                log_level="INFO",
            ),
        ),
    )
```

```typescript title="Node JS" Node JS theme={null}
import * as zeroruntime from '@zeroruntime/js-sdk';
import { Exporter, Observability, Room } from '@zeroruntime/js-sdk';

zeroruntime.serve(MyVoiceAgent, {
  room: Room({
    name: 'Logs Agent',
    observability: Observability({
      logs: Exporter({
        enabled: true,
        export_url: 'https://otel-collector.example.com/v1/logs',
      }),
      log_level: 'INFO',
    }),
  }),
});
```

Replace the example URL with your collector's logs endpoint. Set the `Room` on `serve()` to apply it to every session, or on `invoke()` to apply it to one session.

| Exporter field | Type | Default | Description |
| - | - | - | - |
| `enabled` | `bool` | `True` | Turns the log export on or off. Set it to `False` to stop exporting while keeping the rest of the configuration. |
| `export_url` | `str` | `None` | The OTLP endpoint to send logs to. `None` uses the runtime's default destination. |
| `export_headers` | `dict[str, str]` | `{}` | Headers sent with each export. Put your vendor's API key or auth header here. |

> [!NOTE]
>
> Leaving `logs` unset is not the same as turning it off. An unset stream follows the runtime's default settings. To stop exporting logs, pass `Exporter(enabled=False)`.

## What's Next

> [card] [Metrics](https://docs.zeroruntime.ai/runtime-sdk/build/observability-and-monitoring/melt/metrics.md)
>
> Read per-stage latency and token usage.

> [card] [Traces](https://docs.zeroruntime.ai/runtime-sdk/build/observability-and-monitoring/melt/traces.md)
>
> Follow each turn span by span and export the spans.

## References

> [tab] Python
>
> #### Examples
>
> > [card] [Observability Hooks](https://github.com/ZeroRuntimeAI/zeroruntime-python-examples/blob/main/observability/observability_hooks.py)
> >
> > Configure observability for a session.

> [tab] Node JS
>
> #### Examples
>
> > [card] [Pipeline Events](https://github.com/ZeroRuntimeAI/zeroruntime-js-examples/blob/main/observability/pipeline_events.ts)
> >
> > Configure observability for a session.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.