# Diagnostic logging: Activix → xronox-store → xronox

**Scope:** This file is **Activix documentation only** — a single place for operators to see how logging is layered when using Activix. It does **not** prescribe changes to downstream packages; treat **`@x12i/xronox-store`** and **`@x12i/xronox`** as the source of truth for their own behavior and docs when you need details or updates from those repos.

Activity persistence goes through **`@x12i/activix`** → **`@x12i/xronox-store`** → **`@x12i/xronox`**. Each layer has **its own** controls. Turn on the layers you need when tracing writes, cache behavior, or Mongo routing.

## Quick reference

| Order | Package | Purpose | Level / enable (examples) | Implementation |
|------|---------|---------|---------------------------|----------------|
| 1 (top) | **`@x12i/activix`** | Storage mode probe, `patchRecord` warnings, internal diagnostics | Default: errors only. **`ENABLE_ACTIVIX_LOGXER=true`** enables full diagnostics; optional **`ACTIVIX_LOGS_LEVEL`** controls level | Built-in console diagnostics; routine info/warn/debug are gated to prevent noise about activity-log writes |
| 2 | **`@x12i/xronox-store`** | Store-level diagnostics (`[xronox-store]` lines) | Per that package’s README (e.g. store log switch) | Console; optional `logger` on `XronoxStore` |
| 3 (bottom) | **`@x12i/xronox`** | Engine / adapter verbose traces | **`XRONOX_VERBOSE=1`** or **`XRONOX_LOGS=1`** (`1`, `true`, or `yes` — **not** `on`) | `XRONOX_*` only; plain `DEBUG=1` does **not** enable xronox diagnostics |

**Typical smoke .env** (verbose end-to-end):

```bash
ENABLE_ACTIVIX_LOGXER=true
ACTIVIX_LOGS_LEVEL=debug
XRONOX_STORE_LOG=1
XRONOX_VERBOSE=1
```

**Errors only:** unset `ENABLE_ACTIVIX_LOGXER` (default) or set `ACTIVIX_LOGS_LEVEL=error` when logxer is enabled.

Use **`isActivixDiagnosticLoggingEnabled()`** from Activix to detect the combined opt-in: **`ENABLE_ACTIVIX_LOGXER=true`** and not silenced by **`ACTIVIX_LOGS_LEVEL`**. xronox-store documents its own helpers and env names.

## logs-gateway

Activix depends on **logs-gateway** **^3.6.0**. Per-package and cross-cutting behavior: [logs-gateway README](https://www.npmjs.com/package/logs-gateway), **`.docs/package-logging-logs-gateway-env.md`**, and **`docs/package-usage.md`** inside the **logs-gateway** package.

## Optional further reading (downstream)

Links are for convenience when you want the **canonical** docs for a dependency:

- **xronox-store:** [README](https://github.com/x12i/xronox-store/blob/main/README.md) (logging section).
- **xronox:** [README](https://github.com/x12i/xronox/blob/main/README.md).
