✦Open Source·AI-Powered·Self-Hostable

AI-Powered Log Analysis for Microservices

Stream, search, and debug logs in real time. Spring Boot ingestion, Next.js dashboard, Kafka, Elasticsearch, Redis, and optional AI analysis — self-hosted in under an hour.

Apache 2.0
Docker Ready
Java SDK
Zero Vendor Lock-in
LogSpectra Dashboard
Live
14:23:01.234INFOgatewayRequest processed successfully
14:23:01.456WARNauth-svcToken expiring in 5 minutes
14:23:01.789INFOuser-svcUser profile updated
14:23:02.012ERRORpaymentPayment gateway timeout
Open Source

Built in the open. Owned by you.

Apache Licensed

Use it, modify it, ship it. No strings attached.

Self-Hostable

One Docker command. Runs on your infra.

Fully Customizable

Swap components, extend pipelines, fork freely.

What is LogSpectra

Everything you need for log observability

From ingestion to AI-powered root cause analysis — LogSpectra closes the full loop.

AI analysis (SSE)

Analyze from Explorer with streaming tokens, severity, confidence, suggested fixes, and optional GitHub remediation PRs.

Live log stream

Kafka ingestion with SSE to the UI — alerts on ERROR lines without polling.

Search & analytics

Elasticsearch-backed Explorer, Dashboard charts, and Analytics (triage, endpoints, severity mix).

Java starter SDK

Spring Boot auto-config: JSON logs to Kafka with traceId, endpoint, stack traces, and projectId.

Using LogSpectra

One console for search, streaming, and AI triage

The Next.js UI talks to the Spring Boot API on port 8081. Pick a project and time range in the header — they stay in the URL so you can bookmark or share links across Dashboard, Explorer, Issues, and Analytics.

Dashboard

Error rate, severity mix, top endpoints, and weekly trends for the selected project and time range.

Live

SSE stream of incoming logs with charts — same global project and time filters as the rest of the app.

Explorer

Search and filter logs, Analyze with AI, then Apply fix on GitHub when a GitHub App + service git-url are configured.

Issues

Grouped fingerprints with severity, occurrence counts, and linked analysis history.

Analytics

Error triage over time, ingestion rate, AI usage, severity mix, and service error trends.

Severity rules

Global exception-pattern rules that override default severity during ingestion.

Settings

AI provider credentials and models (OpenAI, Claude, Ollama, Gemini), per project in the header.

Example shareable link: /explorer?projectId=<uuid>&range=24h. Custom ranges use range=custom&from=…&to=… (ISO-8601).

Architecture

Simple pipeline. Powerful outcomes.

Spring Boot apps
Kafka
Elasticsearch
Backend API
PostgreSQL + Redis
AI providers
Next.js UI
3 reposBackend · UI · Starter
Java 21Backend & starter target
Apache 2.0Open source license
Quick Start

From zero to monitoring in minutes.

1

Download compose (Docker Hub)

Fastest path: pull published images from Docker Hub — logspectra/logspectra-backend and logspectra/logspectra-ui — plus Postgres, Redis, Kafka, and Elasticsearch. Prefer building from source? Clone logspectra-backend / logspectra-ui.

docker-compose.yml
services:
  postgres:
    image: postgres:16
    environment:
      POSTGRES_DB: ${POSTGRES_DB:-logspectra}
      POSTGRES_USER: ${POSTGRES_USER:-postgres}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
    ports:
      - "${POSTGRES_HOST_PORT:-5432}:5432"
    volumes:
      - postgres-data:/var/lib/postgresql/data

  redis:
    image: redis:7
    ports:
      - "${REDIS_HOST_PORT:-6379}:6379"

  zookeeper:
    image: confluentinc/cp-zookeeper:7.6.1
    environment:
      ZOOKEEPER_CLIENT_PORT: 2181
      ZOOKEEPER_TICK_TIME: 2000

  kafka:
    image: confluentinc/cp-kafka:7.6.1
    depends_on:
      - zookeeper
    ports:
      - "${KAFKA_HOST_PORT:-9092}:9092"
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:${KAFKA_HOST_PORT:-9092}
      KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"

  elasticsearch:
    image: elasticsearch:8.15.2
    environment:
      discovery.type: single-node
      xpack.security.enabled: "false"
      ES_JAVA_OPTS: -Xms1g -Xmx1g
    ports:
      - "${ELASTICSEARCH_HOST_PORT:-9200}:9200"
    volumes:
      - es-data:/usr/share/elasticsearch/data

  logspectra-backend:
    # Apple Silicon (Finch/Docker): use Hub tags built after multi-arch CI, or add platform: linux/amd64 for older tags
    image: ${DOCKERHUB_NS:-logspectra}/logspectra-backend:${LOGSPECTRA_TAG:-latest}
    depends_on:
      - postgres
      - redis
      - kafka
      - elasticsearch
    ports:
      - "${APP_HOST_PORT:-8081}:8081"
    environment:
      SERVER_PORT: "8081"
      SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/${POSTGRES_DB:-logspectra}
      SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER:-postgres}
      SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
      SPRING_DATA_REDIS_HOST: redis
      KAFKA_BOOTSTRAP_SERVERS: kafka:29092
      ELASTICSEARCH_URIS: http://elasticsearch:9200
      AI_PROVIDER: ${AI_PROVIDER:-ollama}
      AI_OLLAMA_HOST: ${AI_OLLAMA_HOST:-host.docker.internal}
      AI_OLLAMA_PORT: ${AI_OLLAMA_PORT:-11434}

  logspectra-ui:
    image: ${DOCKERHUB_NS:-logspectra}/logspectra-ui:${LOGSPECTRA_TAG:-latest}
    # platform: linux/amd64  # uncomment on ARM Mac if pull fails with "no match for platform"
    depends_on:
      - logspectra-backend
    ports:
      - "${UI_HOST_PORT:-3050}:3050"
    environment:
      NEXT_PUBLIC_API_BASE_URL: ${NEXT_PUBLIC_API_BASE_URL:-http://localhost:8081}
      # Server-side SSE proxy (browser uses localhost; UI container uses service DNS)
      LOGSPECTRA_API_URL: ${LOGSPECTRA_API_URL:-http://logspectra-backend:8081}

volumes:
  postgres-data:
  es-data:
2

Pull & start the stack

docker pull logspectra/logspectra-backend:latest
docker pull logspectra/logspectra-ui:latest
docker compose up -d

First run pulls images; later starts are fast. Override namespace with DOCKERHUB_NS=youruser if you published under another Hub account.

Defaults are overridable via env vars (APP_HOST_PORT, UI_HOST_PORT, AI keys, etc.). No need to edit the compose file for a first run.
3

Open the dashboard

UI (Docker Hub):
http://localhost:3050
API:
http://localhost:8081
Login:admin / admin

Developing the UI from source?

# Option A — Docker Hub (with the compose file from Quick Start):
docker compose up -d
# UI → http://localhost:3050   API → http://localhost:8081

# Option B — develop from source
git clone https://github.com/logspectra/logspectra-ui.git
cd logspectra-ui && pnpm install && pnpm dev
# Dashboard → http://localhost:3000
4

Login & create a project

Default login:admin / admin
Change credentials after first login

Open Projects, create a project, then copy its UUID for the Java starter (not the display name).

New Project

my-microservices
Production microservices logs

After creation, copy your Project ID — you'll need it in the next step.

Project ID:
a1b2c3d4-e5f6-7890-abcd-ef1234567890
5

Configure the Java starter

Add to your Spring Boot app's application.yml (see logspectra-starter):

application.yml
logspectra:
  enabled: true
  service-name: gateway-service
  project-id: YOUR_PROJECT_UUID
  kafka:
    enabled: true
    bootstrap-servers: localhost:9092
    topic: service-logs
  # Optional — required for "Apply fix on GitHub" / remediation PRs
  code-source:
    git-url: https://github.com/YOUR_ORG/gateway-service.git
    default-branch: main
  registry:
    enabled: true
    backend-url: http://localhost:8081
service-nameIdentifies which microservice sent this logproject-idLinks logs to your project in the UI
6

Add Maven Dependency

pom.xml
<dependency>
  <groupId>com.github.logspectra</groupId>
  <artifactId>logspectra-starter</artifactId>
  <version>1.0.2</version>
</dependency>

The starter auto-configures log interception. No additional code required — just the dependency and YAML above.

7

Explore, analyze, track issues

Logs flow Kafka → Elasticsearch → UI.

  • Live — watch the stream; Explorer — search and run Analyze (SSE).
  • Issues groups errors by fingerprint; Analytics shows triage and trends.
  • Configure AI under Settings. To open PRs from suggested fixes, set up a GitHub App + service git-url, then use Apply fix on GitHub in Explorer.
Open dashboard
AI Analysis

AI-powered root cause analysis, built in.

Connect any AI provider, click Analyze, and let LogSpectra diagnose your logs automatically — root cause, explanation, and a suggested fix, streamed directly to your dashboard.

From Explorer, Analyze sends trace-scoped logs through POST /api/v1/logs/analyze (SSE). Settings stores provider keys in the backend; Docker can still seed defaults via env vars. Code-aware prompts use the optional logspectra-ai integration when enabled on the backend.

Microservices
Kafka
Elasticsearch
LogSpectra Backend
"Analyze" clicked
AI Provider
Dashboard UI
SSE analyze APIprogress · token · result · complete
4 providersOllama · OpenAI · Claude · Gemini
Evidence-based confidenceBlends model score with log signals

Choose your AI provider

Local · Free

Ollama

Run AI models entirely on your own machine. No API key, no data leaves your network. Best for development and privacy-sensitive environments.

1Install Ollama from ollama.com
2Pull a model — ollama pull qwen3.5:cloud
3Ollama runs on port 11434 by default — no extra config needed if running locally
AI_PROVIDER=ollama
AI_OLLAMA_HOST=host.docker.internal
AI_OLLAMA_PORT=11434

Use host.docker.internal so the Docker container can reach Ollama running on your host machine.

Recommended models: qwen3.5:cloud, mistral, gemma2

Cloud · API Key Required

OpenAI

Use GPT-4o or GPT-3.5-turbo for high-quality log analysis. Requires an OpenAI API key. Fastest setup with no local dependencies.

AI_PROVIDER=openai
AI_OPENAI_API_KEY=your_api_key_here

Get your API key from platform.openai.com.

Recommended models: gpt-4o, gpt-4-turbo, gpt-3.5-turbo

Cloud · API Key

Claude

Anthropic models for nuanced distributed-system failures.

AI_PROVIDER=claude
AI_CLAUDE_API_KEY=your_api_key_here

Get your API key from console.anthropic.com.

Recommended models: claude-sonnet-4-5, claude-opus-4-5

Cloud · API Key

Gemini

Google Gemini via API key — useful when you already standardize on Google AI.

AI_PROVIDER=gemini
AI_GEMINI_API_KEY=your_api_key_here

Set AI_GEMINI_API_KEY or GEMINI_API_KEY in compose / Settings.

Recommended models: gemini-2.0-flash

Apply configuration to your deployment

These env vars are added to the existing docker-compose.yml setup from the Quick Start section — no need to rebuild.

.env
# Add to your existing .env file

# Choose one provider:
AI_PROVIDER=ollama
AI_OLLAMA_HOST=host.docker.internal
AI_OLLAMA_PORT=11434

# --- OR ---

AI_PROVIDER=openai
AI_OPENAI_API_KEY=your_api_key_here

# --- OR ---

AI_PROVIDER=claude
AI_CLAUDE_API_KEY=your_api_key_here

# --- OR ---

AI_PROVIDER=gemini
AI_GEMINI_API_KEY=your_api_key_here

Then run:

docker-compose up -d
Only one provider is active at a time. The AI_PROVIDER variable determines which one LogSpectra uses. You can switch providers at any time by updating the env and restarting.

Configure your provider in the UI

1

Open Settings

Use the sidebar → Settings (AI provider section).

2

Select Provider

Ollama, OpenAI, Claude, or Gemini.

3

Select Model

Pick a model for that provider (saved per project context).

4

Save

Credentials are stored server-side; retry Analyze from Explorer.

Settings/AI Provider
Ollama
qwen3.5:cloud
Settings saved

How analysis works, step by step

1

Open Explorer

Select project and time range in the header, search logs, and open a trace or error cluster you want to investigate.

2

Click Analyze

Choose provider (or use Settings default). The backend loads matching logs, enriches with optional GitHub code context, and calls your AI provider.

3

Watch the stream

SSE events stream tokens while the model runs. The final result event includes structured JSON: summary, root cause, fixes, severity, and confidence.

4

Review the panel

The analysis panel shows severity, confidence, what happened, root cause, and prioritized fixes (including search/replace patches when available).

●What happened — short error summary
◉Root cause — technical diagnosis
◆Suggested fixes — with optional file paths and patches
5

Track & remediate

Analysis upserts an Issue fingerprint. After you connect a GitHub App and register each service git-url (see Fix from logs), click Apply fix on GitHub to open a remediation PR.

AI Analysis·gateway-service·2 minutes ago
Live
HIGHConfidence72%

What happened

Payment service timed out calling the gateway during checkout.

Root cause

Null session in OrderController during token refresh under concurrent load.

Suggested fixes

Guard session.getUser() in OrderController.java — return 401 when absent; add integration test for refresh race.

Fix from logs

Connect GitHub so Analyze can open a PR

LogSpectra does not push to your repos until you install a GitHub App and register each service's git-url. After that, Explorer's Apply fix on GitHub creates a remediation pull request with search/replace patches from AI analysis.

1

Create a GitHub App

In your org (or user) → Settings → Developer settings → GitHub Apps. Grant Contents (R/W) and Pull requests (R/W). Download the private key PEM and note the App ID.

2

Install on your service repos

Install the App on the microservice repos you want LogSpectra to patch (e.g. gateway-service). Copy the installation ID from the install URL.

3

Configure logspectra-backend

Pass App ID, installation ID, and the PEM path (or PEM body) via env / application.yml. Enable PR creation. Backend needs git on PATH when workspace mode is on (default).

4

Register each service’s git URL

In the Spring Boot starter YAML, set code-source.git-url + registry.backend-url. On startup the starter POSTs the mapping so Analyze/Remediate know which repo owns that service.

5

Analyze → Apply fix on GitHub

In Explorer, run Analyze. When suggested fixes include filePath + search/replace, click Apply fix on GitHub. LogSpectra opens (or updates) a branch and PR in that service repo.

GitHub App repository permissions

PermissionAccessWhy
ContentsRead & writeCreate branch and commit patches
Pull requestsRead & writeOpen / update remediation PRs
MetadataRead-onlyRequired default

Backend env (.env / compose)

.env
# GitHub App (logspectra-backend)
GITHUB_APP_ENABLED=true
GITHUB_APP_ID=123456
GITHUB_APP_INSTALLATION_ID=987654321
GITHUB_APP_PRIVATE_KEY_PATH=/secrets/logspectra-github-app.pem
# Or inline PEM (use \n for newlines):
# GITHUB_APP_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----\n...

GITHUB_PR_ENABLED=true
# Prefer clicking "Apply fix on GitHub" in the UI; set true to auto-open PR after Analyze
GITHUB_PR_AUTO_CREATE=false
GITHUB_PR_REVIEWERS=alice,bob

Or use YAML — see SETUP-GITHUB-APP.md in logspectra-backend.

application.yml
github:
  app:
    enabled: true
    app-id: "123456"
    installation-id: "987654321"
    private-key-path: /secrets/logspectra-github-app.pem
  pr:
    enabled: true
    auto-create-after-analysis: false
    reviewers: alice,bob
  workspace:
    enabled: true   # clone/commit/push on the backend host (needs git)

Starter — register git URL

application.yml
logspectra:
  enabled: true
  service-name: gateway-service
  project-id: YOUR_PROJECT_UUID
  kafka:
    enabled: true
    bootstrap-servers: localhost:9092
    topic: service-logs
  code-source:
    git-url: https://github.com/YOUR_ORG/gateway-service.git
    default-branch: main
  registry:
    enabled: true
    backend-url: http://localhost:8081
    # token: optional shared secret → X-LogSpectra-Registry-Token

On boot, the starter POSTs to /api/v1/services/code-registry so the backend can map service-name → repo for patches and PRs.

In the UI

After Analyze
  1. Open a log / trace in Explorer
  2. Click Analyze (AI streams root cause + fixes)
  3. Click Apply fix on GitHub — requires App + registered git-url
Remediation PR opened
#42 · logspectra/fix-…
Without the GitHub App + service registry, Analyze still works (summary, root cause, suggested fixes). Only Apply fix on GitHub / remediation PRs need this setup. Keep the PEM out of git — mount it as a secret or use GITHUB_APP_PRIVATE_KEY.
Why LogSpectra

Built for teams who can't afford blind spots.

Cut Debugging Time

Stop grep-ing through files. Find the root cause in seconds, not hours.

Centralized Observability

One dashboard for all your services. No more switching between log files.

AI-Powered Insights

Not just logs — understanding. Analyze from Explorer, track Issues, and tune Severity rules.

Zero-Code Integration

One dependency. One YAML block. Works with any Spring Boot service instantly.

Start monitoring your logs in minutes.

Free forever. No account needed. Runs entirely on your infrastructure.