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.
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.
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.
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).
Simple pipeline. Powerful outcomes.
From zero to monitoring in minutes.
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.
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:Pull & start the stack
docker pull logspectra/logspectra-backend:latest
docker pull logspectra/logspectra-ui:latest
docker compose up -dFirst run pulls images; later starts are fast. Override namespace with DOCKERHUB_NS=youruser if you published under another Hub account.
APP_HOST_PORT, UI_HOST_PORT, AI keys, etc.). No need to edit the compose file for a first run.Open the dashboard
admin / adminDeveloping 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:3000Login & create a project
admin / adminOpen Projects, create a project, then copy its UUID for the Java starter (not the display name).
New Project
After creation, copy your Project ID — you'll need it in the next step.
Configure the Java starter
Add to your Spring Boot app's application.yml (see logspectra-starter):
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:8081Add Maven Dependency
<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.
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.
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.
Choose your AI provider
Ollama
Run AI models entirely on your own machine. No API key, no data leaves your network. Best for development and privacy-sensitive environments.
ollama pull qwen3.5:cloudAI_PROVIDER=ollama
AI_OLLAMA_HOST=host.docker.internal
AI_OLLAMA_PORT=11434Use host.docker.internal so the Docker container can reach Ollama running on your host machine.
Recommended models: qwen3.5:cloud, mistral, gemma2
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_hereGet your API key from platform.openai.com.
Recommended models: gpt-4o, gpt-4-turbo, gpt-3.5-turbo
Claude
Anthropic models for nuanced distributed-system failures.
AI_PROVIDER=claude
AI_CLAUDE_API_KEY=your_api_key_hereGet your API key from console.anthropic.com.
Recommended models: claude-sonnet-4-5, claude-opus-4-5
Gemini
Google Gemini via API key — useful when you already standardize on Google AI.
AI_PROVIDER=gemini
AI_GEMINI_API_KEY=your_api_key_hereSet 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.
# 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_hereThen run:
docker-compose up -dConfigure your provider in the UI
Open Settings
Use the sidebar → Settings (AI provider section).
Select Provider
Ollama, OpenAI, Claude, or Gemini.
Select Model
Pick a model for that provider (saved per project context).
Save
Credentials are stored server-side; retry Analyze from Explorer.
How analysis works, step by step
Open Explorer
Select project and time range in the header, search logs, and open a trace or error cluster you want to investigate.
Click Analyze
Choose provider (or use Settings default). The backend loads matching logs, enriches with optional GitHub code context, and calls your AI provider.
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.
Review the panel
The analysis panel shows severity, confidence, what happened, root cause, and prioritized fixes (including search/replace patches when available).
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.
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.
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.
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.
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.
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).
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.
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
| Permission | Access | Why |
|---|---|---|
| Contents | Read & write | Create branch and commit patches |
| Pull requests | Read & write | Open / update remediation PRs |
| Metadata | Read-only | Required default |
Backend env (.env / compose)
# 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,bobOr use YAML — see SETUP-GITHUB-APP.md in logspectra-backend.
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
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-TokenOn 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
- Open a log / trace in Explorer
- Click Analyze (AI streams root cause + fixes)
- Click Apply fix on GitHub — requires App + registered
git-url
GITHUB_APP_PRIVATE_KEY.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.