How ramijaber4/logsanalyzer works
Log Analyzer accepts raw log lines, processes them asynchronously in batches, and exposes aggregated global and per-component metrics through a browser UI and API. The main path runs from a log sender through the FastAPI queue, worker, parser and calculator, then MySQL; the browser uses a lightweight proxy to access API routes and static UI. Reset and health/statistics routes are distinct backend capabilities. The README documents the UI, while its implementation was not sampled; links involving its API use follow the documented proxy behavior.
Main entry points: app.py FastAPI routes · worker.py Batch worker · frontend_server.py Frontend proxy · database.py Database manager
Components 12
Browser interface
- HTML and JS UI
frontend/index.html - Frontend proxy
frontend/frontend_server.py
API service
- FastAPI routes
app.py
Log processing
- Async log queue
queue_manager.py - Batch worker
worker.py - Log parser
processing_logs.py - Metrics calculator
processing_logs.py
Metrics storage
- Database manager
database.py - Metrics tables
init.sql
Other components
- Browser user
- Log sender
- MySQL
Connections 18
- Browser user → Frontend proxy: requests UI
- Frontend proxy → HTML and JS UI: serves UI
- Frontend proxy → FastAPI routes: forwards API
- FastAPI routes → Frontend proxy: returns API response
- Frontend proxy → Browser user: returns response
- Log sender → FastAPI routes: submits logs
- FastAPI routes → Async log queue: enqueues logs
- FastAPI routes → Database manager: reads stats
- Database manager → FastAPI routes: returns stats
- FastAPI routes → Database manager: resets metrics
- FastAPI routes → Metrics calculator: resets memory
- Batch worker → Async log queue: dequeues logs
- Batch worker → Log parser: parses lines
- Log parser → Batch worker: returns log
- Batch worker → Metrics calculator: aggregates logs
- Batch worker → Database manager: flushes batches
- Database manager → MySQL: queries and updates
- Metrics tables → MySQL: defines tables