A lightweight, high-performance platform for collecting, storing, and analyzing logs from script executions.
Never lose track of your script runs again! SwiftLog captures every execution, streams logs in real-time, and provides AI-powered analysis—all with zero code changes.
Wrap any command or pipe output directly—no code changes required:
swiftlog run -- ./your-script.sh
# or
./your-script.sh | swiftlog pipeWatch script output live in a beautiful web interface with <2s latency from execution to browser.
Captures exact exit codes, execution duration, and status. Know exactly when and why your scripts fail.
Automatic log analysis using OpenAI. Get instant insights, error summaries, and recommendations.
RESTful API and WebSocket support for seamless integrations with your existing tools.
git clone https://github.com/aliancn/swiftlog.git
cd swiftlog
cp .env.example .env # Edit with your settings
make startThat's it! All services start automatically:
- ✅ PostgreSQL with auto-migrated schema
- ✅ Grafana Loki for log storage
- ✅ Redis for pub/sub
- ✅ Backend services (Ingestor, API, WebSocket, AI Worker)
- ✅ Frontend web application
make cli
./cli/swiftlog config set --token YOUR_TOKEN --server localhost:50051cd cli
./swiftlog run --project myapp --group tests -- echo "Hello, SwiftLog!"Open http://localhost:3000 to see your logs in real-time!
# Run a build script
swiftlog run --project webapp --group build -- ./build.sh
# Run Python script
swiftlog run --project ml --group training -- python train_model.py
# Auto-detect project from git repo
swiftlog run -- npm test# Commands with pipes
swiftlog run -- bash -c "cat data.csv | grep ERROR | wc -l"
# Long-running processes
swiftlog run --project etl --group daily -- python process_data.py --date today# GitHub Actions, GitLab CI, Jenkins, etc.
swiftlog run --project myapp --group ci-build -- make build
swiftlog run --project myapp --group ci-test -- make test┌─────────────┐
│ CLI │ ──gRPC──► Ingestor ──► Loki (Logs)
└─────────────┘ │
▼
PostgreSQL (Metadata)
▲
┌──────────────────┼──────────────────┐
│ │ │
REST API WebSocket Server AI Worker
│ │ │
└──────────────────┴──────────────────┘
│
Frontend
Components:
- CLI Tool - Wraps commands and streams logs via gRPC
- Ingestor - Receives logs and writes to Loki/PostgreSQL
- REST API - HTTP endpoints for querying and management
- WebSocket - Real-time log streaming to browsers
- AI Worker - Background AI analysis using OpenAI
- Frontend - Next.js 14 web interface
- Project names from git repo, CI/CD vars, or directory
- Group names generated from commands
- Configurable defaults and project-level config files
- OpenAI-compatible API support (Azure, LocalAI, Ollama)
- Customizable AI models
- Environment-based configuration
- Docker Compose for easy deployment
- SHA-256 hashed API tokens
- JWT authentication
- Encrypted sensitive data
- Network isolation for infrastructure services
- CORS configuration
- GitHub Actions CI/CD workflows
- Pre-built binaries for Linux, macOS, Windows
- Docker images on GitHub Container Registry
- Automated deployment scripts
- Health checks and monitoring
Comprehensive documentation is available in the docs/ folder:
| Document | Description |
|---|---|
| Getting Started | Installation and quick start guide |
| CLI Guide | Complete CLI tool documentation |
| API Reference | REST and WebSocket API documentation |
| Architecture | System design and components |
| Configuration | Environment variables and settings |
| Deployment | Production deployment guide |
| Development | Contributing and local development |
| Service | URL | Description |
|---|---|---|
| Frontend | http://localhost:3000 | Web interface |
| REST API | http://localhost:8080 | HTTP API |
| WebSocket | ws://localhost:8081 | Real-time streaming |
| gRPC Ingestor | localhost:50051 | CLI connection |
| Layer | Technology |
|---|---|
| Backend | Go 1.24+, gRPC, Gin, gorilla/websocket |
| Frontend | Next.js 14, TypeScript 5, Tailwind CSS |
| Database | PostgreSQL 16 |
| Log Storage | Grafana Loki 2.9 |
| Pub/Sub | Redis 7 |
| AI | OpenAI API |
| Deployment | Docker, Docker Compose |
Download CLI binaries from Releases:
# Linux
wget https://github.com/aliancn/swiftlog/releases/latest/download/swiftlog-linux-amd64
chmod +x swiftlog-linux-amd64
sudo mv swiftlog-linux-amd64 /usr/local/bin/swiftlog
# macOS (ARM)
wget https://github.com/aliancn/swiftlog/releases/latest/download/swiftlog-darwin-arm64
chmod +x swiftlog-darwin-arm64
sudo mv swiftlog-darwin-arm64 /usr/local/bin/swiftlog
# Windows
# Download swiftlog-windows-amd64.exe from releasesPre-built images available on GitHub Container Registry:
docker pull ghcr.io/aliancn/swiftlog/api:latest
docker pull ghcr.io/aliancn/swiftlog/ingestor:latest
docker pull ghcr.io/aliancn/swiftlog/websocket:latest
docker pull ghcr.io/aliancn/swiftlog/ai-worker:latest
docker pull ghcr.io/aliancn/swiftlog/frontend:latestgit clone https://github.com/aliancn/swiftlog.git
cd swiftlog
# Build CLI
make cli
# Build all services
make build# .env
POSTGRES_PASSWORD=your-password
JWT_SECRET=$(openssl rand -base64 32)
ENCRYPTION_KEY=$(openssl rand -base64 32)# .env
POSTGRES_PASSWORD=$(openssl rand -base64 32)
JWT_SECRET=$(openssl rand -base64 32)
ENCRYPTION_KEY=$(openssl rand -base64 32)
PUBLIC_URL=https://logs.yourdomain.com
CORS_ORIGINS=https://logs.yourdomain.com
OPENAI_API_KEY=sk-your-key # Optional for AI featuresSee Configuration Guide for all options.
# Run integration tests
cd tests
./run_all_tests.sh
# Individual tests
./cli/swiftlog run --project test --group simple -- bash tests/01_simple_test.sh- Configure GitHub Secrets (see Deployment Guide)
- Push a version tag:
git tag v1.0.0
git push origin v1.0.0This automatically:
- Builds multi-platform CLI binaries
- Creates GitHub Release
- Builds and pushes Docker images
- Deploys to your server (optional)
# On your server
git clone <repository-url>
cd swiftlog
cp .env.example .env
# Edit .env with production values
docker compose up -dSee Deployment Guide for detailed instructions.
We welcome contributions! Please see our Development Guide for:
- Setting up local development environment
- Code style and standards
- Testing requirements
- Pull request process
- Documentation: docs/index.md
- Issues: GitHub Issues
- Discussions: GitHub Discussions
If you find SwiftLog useful, please consider giving it a star! ⭐
Built with ❤️ using Go, TypeScript, and Docker