Lograil

command module
v0.0.0-...-d1a2abc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

README

Lograil

A lightweight, project-oriented log management platform built on VictoriaLogs, designed for resource-constrained environments, modern backend services, and small to mid-sized teams.

Architecture

Lograil consists of three main components:

  • Control Plane Backend: Manages authentication, authorization, user management, and system configuration
  • Ingestion Backend: High-performance log ingestion service supporting multiple protocols
  • Web UI: Modern React-based interface for log exploration and management

For detailed architecture information, see:

Quick Start

Prerequisites
  • Go 1.21+
  • Node.js 24+
  • pnpm
  • Docker and Docker Compose
  • SQLite3 (automatically handled in containers)
Development Setup
  1. Clone the repository
   git clone https://github.com/bizjs/Lograil.git
   cd lograil

generate service

kratos proto server -t app/log-control/internal/service api/v1/log-control/user.proto


2. **Build all components**

```bash
make build
  1. Start development environment

    make dev-setup
    
  2. Access the services

Manual Development

If you prefer to run services individually:


kratos proto server api/v1/log_ingestor.proto -t app/log-ingestor/internal/service


# Terminal 1: Start databases (Redis and VictoriaLogs)
cd docker && docker-compose up redis victorialogs -d

# Terminal 2: Start Control Plane (SQLite database will be created automatically)
cd control-plane && go run cmd/server/main.go

# Terminal 3: Start Ingestion Backend
cd ingestion && go run cmd/server/main.go

# Terminal 4: Start Web UI
cd web-ui && pnpm dev

API Usage

Ingest Logs
# Single log entry
curl -X POST http://localhost:9011/ingest/logs \
  -H "Content-Type: application/json" \
  -d '{
    "level": "info",
    "message": "User logged in",
    "source": "auth-service",
    "fields": {"user_id": 123}
  }'

# Batch log entries
curl -X POST http://localhost:9011/ingest/batch \
  -H "Content-Type: application/json" \
  -d '{
    "logs": [
      {
        "level": "info",
        "message": "Request processed",
        "source": "api-gateway"
      },
      {
        "level": "error",
        "message": "Database connection failed",
        "source": "user-service"
      }
    ]
  }'
Query Logs
# Get project logs
curl "http://localhost:9012/api/v1/projects/1/logs?query=error&start=2024-01-01T00:00:00Z"

Development

Project Structure
lograil/
├── control-plane/     # Go backend for control plane
├── ingestion/         # Go backend for log ingestion
├── web-ui/           # React frontend
├── docker/           # Docker configurations
├── docs/             # Documentation
└── scripts/          # Build and utility scripts
Available Commands
# Build all components
make build

# Build individual components
make build-control-plane
make build-ingestion
make build-web-ui

# Start/stop Docker services
make docker-up
make docker-down

# View logs
make logs

# Clean build artifacts
make clean

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests: make test
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL