Implemented a complete "View Logs" functionality for the GraphWiz-XR Admin Dashboard with:
- In-memory log storage backend
- REST API endpoints for log querying
- Full-featured React component with filtering, search, and pagination
File: packages/services/reticulum/core/src/log_store.rs
Features:
LogEntrystruct with id, timestamp, level, service, message, contextLogLevelenum: Debug, Info, Warn, ErrorLogStore- Thread-safe in-memory log store with max entries (10,000 per service)LogsQuery- Supports filtering by service, level, time range, searchLogsResponse- Paginated response with entries, total, page, per_page- Global log stores for all services: auth, hub, presence, sfu, storage
add_log()- Async function to add log entries- Tracing layer integration for automatic log capture
Added to: packages/services/reticulum/core/src/lib.rs
pub mod log_store;
pub use log_store::{add_log, get_log_store, LogEntry, LogLevel, LogStore, LogsQuery, LogsResponse};File: packages/services/reticulum/auth/src/admin_handlers.rs
Endpoints:
GET /auth/admin/logs/{service_name}- Fetch logs for specific serviceGET /auth/admin/logs- Fetch logs from all services (with filtering)GET /auth/admin/logs/export- Export logs as JSON file downloadPOST /auth/admin/logs/clear- Clear logs for a service
Query Parameters:
service- Filter by service namelevel- Filter by log level (debug/info/warn/error)start_time- ISO 8601 timestamp (default: last 1 hour)end_time- ISO 8601 timestampsearch- Text search in messagespage- Page number (default: 1)per_page- Items per page (default: 50, max: 1000)
Added to: packages/services/reticulum/auth/src/lib.rs
pub mod admin_handlers;Updated: packages/services/reticulum/auth/src/routes.rs
.route("/admin/logs", web::get().to(admin_handlers::fetch_all_logs))
.route("/admin/logs/export", web::get().to(admin_handlers::export_logs))
.route("/admin/logs/clear", web::post().to(admin_handlers::clear_logs))
.service(web::resource("/admin/logs/{service_name}").route(web::get().to(admin_handlers::fetch_logs)))File: packages/clients/admin-client/src/api-client.ts
New Types:
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
export interface LogEntry {
id: string;
timestamp: string;
level: LogLevel;
service: string;
message: string;
context?: Record<string, unknown>;
}
export interface LogsResponse {
entries: LogEntry[];
total: number;
page: number;
perPage: number;
}
export interface LogsQuery {
service?: string;
level?: LogLevel;
startTime?: string;
endTime?: string;
search?: string;
page?: number;
perPage?: number;
}New Functions:
fetchLogsForService(serviceName, query)- Fetch logs from specific servicefetchLogs(query)- Fetch logs from all services with client-side filteringexportLogs(query)- Export logs as JSON stringapplyFilters(entries, query)- Apply filters and sorting to log entries
File: packages/clients/admin-client/src/LogsViewer.tsx
Features:
-
Filtering:
- Service selector dropdown (All, Auth, Hub, Presence, SFU, Storage)
- Log level dropdown (Debug, Info, Warn, Error)
- Time range picker (1h, 24h, 7d, 30d, 90d)
- Search input with real-time filtering
-
Display:
- Log entries with color-coded level indicators
- Icons: ○ Debug, ● Info, ⚠ Warn, ✕ Error
- Timestamp in local format
- Service badge
- Expandable entries for context details
- Auto-scrolling with max height
-
Pagination:
- Previous/Next buttons
- Page number display
- Total entries count
- Page selector (max 5 pages visible)
-
Auto-Refresh:
- Toggle button (30-second interval)
- Visual indicator (green when enabled, gray when disabled)
- Automatic data reload
-
Export:
- Download logs as JSON file
- Filename: logs-YYYY-MM-DD.json
- Includes metadata (export timestamp, total count)
-
Loading States:
- Spinner during initial load
- Empty state when no logs match
- Button disabled during operations
File: packages/clients/admin-client/src/App.tsx
Changes:
- Added
showLogsViewerstate for modal visibility - Updated "View Logs" button to open modal instead of alert
- Added full-screen modal overlay with LogsViewer component
- Close button (×) to dismiss modal
- Responsive design (max-width: 6xl)
cd packages/services/reticulum/auth
cargo runThe auth service will start on port 8011 with admin log endpoints enabled.
cd packages/services/reticulum/auth
cargo run --bin generate_sample_logsThis will add 100 sample log entries across all services.
cd packages/clients/admin-client
npm run devAdmin dashboard will start on port 5174.
- Open http://localhost:5174
- Click "View Logs" button
- Logs viewer modal will open
- Test features:
- Change service filter (e.g., "Auth")
- Change log level (e.g., "Error")
- Adjust time range (e.g., "Last 24 hours")
- Search for text (e.g., "connection")
- Click pagination buttons
- Toggle auto-refresh
- Click "Export Logs" to download JSON
- Click log entry to expand context
- Click "×" to close modal
GET /auth/admin/logs?service=auth&level=error&search=failed&page=1&per_page=50GET /auth/admin/logs/auth?level=warn&start_time=2026-01-01T00:00:00ZGET /auth/admin/logs/export?service=hub&level=errorPOST /auth/admin/logs/clear{
"entries": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-01-06T12:00:00Z",
"level": "error",
"service": "auth",
"message": "Database connection failed",
"context": {
"error": "Connection refused"
}
}
],
"total": 42,
"page": 1,
"per_page": 50
}- Log entries stored in thread-safe
RwLock<Vec<LogEntry>> - Each service gets dedicated log store (10,000 max entries)
- Log capture via tracing layer (automatic from all log::info/warn/error calls)
- Query filters applied before sorting and pagination
- Sorted by timestamp descending (newest first)
- Fetch logs from
/auth/admin/logsendpoint - Apply additional client-side filters (if needed)
- Display paginated results
- Auto-refresh every 30s (if enabled)
- Export via JSON blob download
- Auth: 8011
- Hub: 8012
- Presence: 8013
- SFU: 8014
- Storage: 8015
- Admin Dashboard: 5174
- In-memory log storage (logs lost on service restart)
- No log rotation or archival
- No log shipping to external services (Loki, CloudWatch)
- No advanced filtering (regex, multiple levels)
- No real-time streaming (Server-Sent Events, WebSocket)
- Only auth service has admin endpoints (needs replication to other services)
- Persistent Storage: Add PostgreSQL table for log persistence
- Log Rotation: Auto-archive old logs to S3/file system
- Real-time Streaming: Implement SSE/WebSocket for live log updates
- Advanced Search: Regex search, multiple level selection, time range picker
- Metrics Integration: Correlate logs with metrics from presence service
- Alerting: Email/webhook on error-level logs
- Multi-service Deployment: Add admin endpoints to all 5 services
- Authentication: Add admin role verification to log endpoints
- ✅
packages/services/reticulum/core/src/log_store.rs(NEW, 220 lines) - ✅
packages/services/reticulum/core/src/lib.rs(MODIFIED, 2 lines added) - ✅
packages/services/reticulum/auth/src/admin_handlers.rs(NEW, 150 lines) - ✅
packages/services/reticulum/auth/src/lib.rs(MODIFIED, 1 line added) - ✅
packages/services/reticulum/auth/src/routes.rs(MODIFIED, 6 lines added) - ✅
packages/services/reticulum/auth/src/generate_sample_logs.rs(NEW, 30 lines)
- ✅
packages/clients/admin-client/src/api-client.ts(MODIFIED, 120 lines added) - ✅
packages/clients/admin-client/src/LogsViewer.tsx(NEW, 310 lines) - ✅
packages/clients/admin-client/src/App.tsx(MODIFIED, 25 lines added)
- Backend: ~400 lines
- Frontend: ~450 lines
- Total: ~850 lines
✅ COMPLETE - All core functionality implemented and ready for testing
- Add admin log endpoints to hub, presence, sfu, storage services
- Implement PostgreSQL log persistence
- Add admin authentication to log endpoints
- Add log rotation and archival
- Implement real-time log streaming
- Add advanced filtering and search capabilities
- Integrate with monitoring/alerting systems