Open Source·AI-Powered·Self-Hostable

AI-Powered Log Analysis for Microservices

Stream, analyze, and debug logs in real-time. Centralized visibility powered by Kafka, Elasticsearch, and AI — set up in under 5 minutes.

MIT License
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 Root Cause Detection

Automatically surfaces anomalies and suggests fixes using LLM-based analysis.

Real-Time Log Streaming

Logs flow instantly via Kafka — no polling, no lag, true streaming.

Kafka + Elasticsearch Pipeline

Battle-tested data pipeline. Scalable, fault-tolerant, production-ready.

Zero-Code SDK Integration

Add one Maven dependency and one YAML block. Nothing else required.

Architecture

Simple pipeline. Powerful outcomes.

Microservices
Kafka
Elasticsearch
LogSpectra Backend
AI Engine
Dashboard UI
< 5 minAverage setup time
< 200msLog ingestion latency
100%Open source
Quick Start

From zero to monitoring in minutes.

1

Download Setup

docker-compose.yml
version: '3.8'

services:
  postgres:
    image: postgres:15
    environment:
      POSTGRES_DB: ${POSTGRES_DB:-logspectra}
      POSTGRES_USER: ${POSTGRES_USER:-logspectra}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-logspectra}
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data

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

  kafka:
    image: confluentinc/cp-kafka:7.4.0
    depends_on:
      - zookeeper
    ports:
      - "${KAFKA_HOST_PORT:-9092}:9092"
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:${KAFKA_HOST_PORT:-9092}
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
    environment:
      - discovery.type=single-node
      - xpack.security.enabled=false
    ports:
      - "9200:9200"
    volumes:
      - es_data:/usr/share/elasticsearch/data

  logspectra:
    image: ghcr.io/kmvipin/logspectra:latest
    depends_on:
      - postgres
      - kafka
      - elasticsearch
    ports:
      - "${APP_HOST_PORT:-8080}:8080"
    environment:
      SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/${POSTGRES_DB:-logspectra}
      SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER:-logspectra}
      SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD:-logspectra}
      KAFKA_BOOTSTRAP_SERVERS: kafka:9092
      ELASTICSEARCH_HOST: elasticsearch
      ELASTICSEARCH_PORT: 9200

volumes:
  postgres_data:
  es_data:
2

Run the System

docker-compose up -d
No need to edit docker-compose.yml directly. All values have sensible defaults and are fully overridable via environment variables.
3

Access the UI

URL:
http://localhost:8080
Username:admin
Password:admin
Change credentials after first login
4

Create a Project

In the LogSpectra UI, create a new project. Each project groups logs from one or more services.

New Project

my-microservices
Production microservices logs

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

Project ID:
proj_a1b2c3d4e5f6
5

Configure SDK

Add this configuration to your application.yml:

application.yml
logspectra:
  enabled: true
  service-name: gateway-service
  project-id: YOUR_PROJECT_ID
  kafka:
    enabled: true
    bootstrap-servers: localhost:9092
    topic: service-logs
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.kmvipin</groupId>
  <artifactId>logspectra-starter</artifactId>
  <version>v1.0.1</version>
</dependency>

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

7

View Logs

Your logs are now flowing into LogSpectra.

  • Open the dashboard → select your project → watch logs arrive in real-time.
  • Use the AI Analysis tab to automatically detect anomalies and get root cause suggestions.
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.

When you click Analyze on any log group in the UI, LogSpectra's backend collects the relevant log entries from Elasticsearch, assembles them into a structured prompt, and sends them to your configured AI provider. The response streams back in real-time — surfacing the root cause, a plain-English explanation, and an actionable fix suggestion.

Microservices
Kafka
Elasticsearch
LogSpectra Backend
"Analyze" clicked
AI Provider
Dashboard UI
Streaming responseAI replies token by token
3 providers supportedOllama · OpenAI · Claude
Zero prompt engineeringLogSpectra builds the prompt for you

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 Required

Claude

Use Anthropic's Claude models for nuanced, context-aware log analysis. Excellent at reasoning through complex 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-opus-4-5, claude-sonnet-4-5

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

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

Click the gear icon in the top-right of the LogSpectra dashboard

2

Select Provider

Choose Ollama, OpenAI, or Claude from the provider dropdown

3

Select Model

Pick a model compatible with your provider (e.g. qwen3.5:cloud, gpt-4o)

4

Save Settings

Click Save. LogSpectra is now ready to analyze logs with AI.

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

How analysis works, step by step

1

Navigate to Logs

Go to your project in the dashboard. Select the service and time range you want to investigate.

2

Click "Analyze"

Click the Analyze button on a log group or error cluster. LogSpectra selects the most relevant log entries automatically.

3

Backend Assembles Context

The backend retrieves logs from Elasticsearch, structures them into a diagnostic prompt, and sends it to your configured AI provider.

4

AI Response Streams In

The AI response appears in a panel below the logs — streaming token by token. You'll see three sections appear progressively:

Root Cause — What triggered the error
Explanation — What the system was doing and why it failed
Suggested Fix — Concrete action to resolve the issue
5

Take Action

Copy the fix, share the analysis with your team, or dismiss and continue investigating.

AI Analysis·gateway-service·2 minutes ago
Live
Root Cause

NullPointerException in OrderController.java:142 caused by a missing user session during token refresh.

Explanation

The gateway service attempted to refresh an OAuth token before the session object was fully initialized. This race condition appears under high concurrency (>200 RPS).

Suggested Fix

Add a null check before calling session.getUser() in OrderController.java:142. Consider using Optional<User> and returning 401 early if the session is absent.

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. Click Analyze on any log group and get root cause, explanation, and a fix suggestion — powered by Ollama, OpenAI, or Claude.

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.

View on GitHubConfigure AI