Skip to content

realMelTuc/logging-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Centralized Logging Dashboard

Port: 5001
URL: http://127.0.0.1:5001
API: http://127.0.0.1:5001/api/log

Purpose

Splunk-like centralized logging for the ecosystem. Collects and displays logs from all ecosystem applications.

Features

  • Centralized Log Collection - Receive logs from any application via HTTP API
  • Search & Filter - Query logs by app, level, time range, and keywords
  • Dashboard View - Real-time log overview with statistics
  • JSON API - Programmatic access to all logs
  • Auto-Registration - Apps automatically registered when they send logs

Quick Start

cd ~/.openclaw/workspace/apps/logging-app
pip install -r requirements.txt
python3 app.py

Sending Logs

Using the Helper Function

from app import log_to_centralized

log_to_centralized(
    app_name="My App",
    app_port=5002,
    level="ERROR",
    message="Something failed",
    source="database.py",
    extra_data={"query": "SELECT * FROM users", "error": "Connection timeout"}
)

Using HTTP API Directly

curl -X POST http://127.0.0.1:5001/api/log \
  -H "Content-Type: application/json" \
  -d '{
    "app_name": "My App",
    "app_port": 5002,
    "level": "ERROR",
    "message": "Database connection failed",
    "source": "db.py",
    "extra_data": {"host": "localhost", "port": 5432}
  }'

Log Levels

  • DEBUG - Detailed info for debugging
  • INFO - General events
  • WARNING - Potential issues
  • ERROR - Errors and failures
  • CRITICAL - Critical failures

API Endpoints

Endpoint Method Description
/ GET Dashboard HTML
/view/<id> GET Single log entry
/api/log POST Submit a log entry
/api/logs GET Query logs with filters
/api/apps GET List registered apps
/clear POST Clear all logs

Query Parameters for /api/logs

  • app - Filter by application name
  • level - Filter by log level
  • search - Search in message/source
  • start - Start timestamp (ISO format)
  • end - End timestamp (ISO format)
  • limit - Max results (default: 100)

Integration Checklist

When building new apps:

  1. Import log_to_centralized from logging-app/app.py
  2. Call it for errors, warnings, and important events
  3. Use appropriate log levels

Configuration

Edit config.py to customize:

  • APP_NAME
  • PORT
  • LOG_LEVELS
  • Theme colors
  • Query limits

About

Logging Dashboard - Centralized Splunk-like logging

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors