---
title: Logs
icon: file-text
description: Set up, configure, and run the Reloop logs microservice locally.
---
> For the complete documentation index, see [llms-docs.txt](/llms-docs.txt) or the site index [llms.txt](/llms.txt). Full docs corpus: [llms-full-docs.txt](/llms-full-docs.txt). Prefer markdown URLs (append `.md`) for agent consumption. Product skill: [skill.md](/skill.md).


Event logging and analytics — activity logs and email delivery data in PostgreSQL.

<Tip>
Run [`bun setup`](/docs/setup) once so Postgres is up (`bun docker:up`). Env files come from `bun setup` / `bun env:setup`.
</Tip>


## Overview

| Property | Value |
| :--- | :--- |
| **Directory** | `apps/backend/logs` |
| **Port** | `8016` |
| **Local URL** | [https://local.reloop.sh/api/logs](https://local.reloop.sh/api/logs) |
| **Swagger UI** | [https://local.reloop.sh/api/logs/openapi](https://local.reloop.sh/api/logs/openapi) |
| **Stack** | ElysiaJS · PostgreSQL · Redis · NATS |


## Quick start

```bash
bun run --filter=be-logs dev
```

Or `bun backend:dev` / `bun dev`.


## Environment

`apps/backend/logs/.env` — from `bun setup` / `bun env:setup`.

```bash
PG_URL=postgresql://reloop:reloop123@localhost:5432/reloop
REDIS_URL=redis://:reloop123@localhost:6379
PORT=8016
BASE_URL="https://local.reloop.sh"
NATS_URL=nats://localhost:4222
NODE_ENV=development
```

| Variable | Required | Default |
| :--- | :--- | :--- |
| `PG_URL` | **YES** | `postgresql://reloop:reloop123@localhost:5432/reloop` |
| `REDIS_URL` | **YES** | `redis://...` |
| `PORT` | **YES** | `8016` |
| `NATS_URL` | **YES** | `nats://localhost:4222` |


## Commands

| Command | Description |
| :--- | :--- |
| `bun run --filter=be-logs dev` | Start dev server with hot reloading |
| `bun run --filter=be-logs build` | Compile production bundle |
| `bun run --filter=be-logs start` | Run compiled production build |
| `bun run --filter=be-logs check-types` | TypeScript type-check |


## Architecture

| Layer | Detail |
| :--- | :--- |
| **Ingestion** | Subscribes to NATS delivery and activity events |
| **Storage** | Writes activity logs to Postgres `activity_log`; email delivery to `email_log` |
| **Query API** | Powers dashboard activity logs and email delivery analytics |
| **Schema** | Defined in `packages/db/src/schema/activity-log.ts` |


## Next

<CardGroup cols={2}>
  <Card icon="rocket" title="Setup" href="/setup">
    One-command local bootstrap
  </Card>
  <Card icon="globe" title="Port reference" href="/setup/port">
    Postgres and gateway ports
  </Card>
  <Card icon="mail-single" title="Mail" href="/setup/backend/mail">
    Source of delivery events
  </Card>
  <Card icon="webhook" title="Webhook" href="/setup/backend/webhook">
    Parallel event delivery path
  </Card>
</CardGroup>
