Skip to content

[Feature Request]: View & Export Logs from Admin UI #138

@crivetimihai

Description

@crivetimihai

🧭 Epic
Title: Log Inspection and Export via Admin Dashboard
Goal: Allow gateway admins to view, filter, and export recent server/tool/resource logs directly from the Admin UI for auditing and debugging.
Why now: As deployments grow more complex, real-time access to logs from the web UI helps in troubleshooting and supports observability goals without relying on shell or container access.


🧭 Type of Feature

  • Enhancement to existing functionality
  • New feature or capability
  • Security Related (for auditability)

🙋‍♂️ User Story 1

As a: gateway admin
I want: to view logs from the Admin UI
So that: I can debug tools, resources, and server behavior without accessing the server logs directly

✅ Acceptance Criteria

Scenario: View recent logs in UI
  Given I am logged into the Admin UI
  When I open a tool, server, or resource details
  Then I see a tab or section showing recent logs (timestamp, level, message)

🙋‍♂️ User Story 2

As a: site operator
I want: to download logs for external analysis
So that: I can archive or inspect them using external tools

✅ Acceptance Criteria

Scenario: Export logs as JSON or CSV
  Given I view logs in the Admin UI
  When I click “Export logs”
  Then I can download a file in JSON or CSV format

📐 Design Sketch

🔧 Backend Changes

  • Expose a paginated GET /logs endpoint, scoped optionally by:

    • entity type (tool, resource, server)
    • entity ID
    • log level
    • timestamp range
GET /logs?type=tool&id=42&level=error&since=2025-06-01T00:00:00Z

🧩 Schema

{
  "timestamp": "2025-06-20T12:34:56Z",
  "level": "ERROR",
  "entity_type": "tool",
  "entity_id": 42,
  "message": "Timeout contacting endpoint"
}

🖥️ UI

  • Add a "Logs" tab in tool/resource/server detail views
  • Display log table with sortable columns (time, level, message)
  • Provide a date range and level filter UI
  • Add “Export as CSV / JSON” button

🧭 Tasks

Area Task Notes
API [ ] Add /logs endpoint with filters JSON output, paginated
UI [ ] Show logs tab per entity view HTMX or dynamic fetch
UI [ ] Export logs feature Format: CSV / JSON
Service [ ] Add log storage support Consider rotating or LRU
Security [ ] Limit access via auth Admin only
Docs [ ] Update admin UI and API docs Swagger + README

🔗 MCP Standards Check

  • ✔️ Log access is read-only and scoped
  • ✔️ Optional filters for targeted debugging
  • ✔️ Backward-compatible; does not affect core MCP ops

Future enhancement: integrate live log streaming via SSE or WebSocket for active monitoring.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestfrontendFrontend development (HTML, CSS, JavaScript)pythonPython / backend development (FastAPI)triageIssues / Features awaiting triage

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions