# Log Store

This guide shows how to configure Kitaru's preferred runtime log backend.

## What this controls

Kitaru has two separate observability channels:

* `kitaru.log(...)` writes **structured metadata** to executions/checkpoints.
* `kitaru log-store ...` configures the backend for **runtime logs**.

By default, runtime logs use `artifact-store`.

## Important: preference vs active stack

`kitaru log-store set` stores a Kitaru-side preference. Runtime log capture still follows the active stack's log-store component. If they differ, Kitaru now shows a warning in:

* `kitaru log-store show`
* `kitaru status`

Use those warnings as a signal that your saved preference and active runtime destination are different.

## Show current log-store backend

```bash
kitaru log-store show
```

This command shows the effective preferred backend and where it came from (`default`, `global user config`, or `environment`).

## Set a global backend override

```bash
kitaru log-store set datadog \
  --endpoint https://logs.datadoghq.com \
  --api-key "{{ DATADOG_KEY }}"
```

This stores a global user-level override and applies to all flows on that machine.

## Reset to default behavior

```bash
kitaru log-store reset
```

Reset removes the persisted global override and returns to default `artifact-store` behavior.

## Environment overrides

Environment variables take precedence over the persisted global setting:

* `KITARU_LOG_STORE_BACKEND`
* `KITARU_LOG_STORE_ENDPOINT`
* `KITARU_LOG_STORE_API_KEY`

Example:

```bash
export KITARU_LOG_STORE_BACKEND=datadog
export KITARU_LOG_STORE_ENDPOINT=https://logs.datadoghq.com
export KITARU_LOG_STORE_API_KEY="${DATADOG_API_KEY}"
kitaru log-store show
```

To force default behavior via environment, set:

```bash
export KITARU_LOG_STORE_BACKEND=artifact-store
unset KITARU_LOG_STORE_ENDPOINT
unset KITARU_LOG_STORE_API_KEY
kitaru log-store show
```

## Related reference pages

* [View execution runtime logs](/kitaru/guides/execution-logs.md)
* [CLI log-store commands](https://docs.zenml.io/sdk-reference)
* [Python logging reference](https://docs.zenml.io/sdk-reference)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zenml.io/kitaru/agent-runtime-stacks/log-store.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
