Skip to content

Feature: Export logs button in the Log Explorer dashboard #111

Description

@claw-io

Feature Request

Requested by: @Avg8888 (via Discord)

It would be awesome to add an export logs button in the logs section of the dashboard.

Current State

The Log Explorer (webui/src/pages/Logs.tsx) has two tabs — Transactions and Failures — both with filtering, pagination, and inline detail views, but no way to export or download the displayed data.

The backend already supports filtered, paginated queries:

  • GET /v1/admin/transactions — supports provider, model, status, search, date_from, date_to filters
  • GET /v1/admin/failures — supports error_type, provider filters

Proposed Feature

Add an Export button to the Log Explorer that lets users download the currently filtered log data.

Suggested scope:

  1. Export format options:

    • CSV — for spreadsheet analysis (tabular columns: timestamp, provider, model, status, tokens_in, tokens_out, cost, etc.)
    • JSON — for full structured data (includes all metadata fields, error chains, etc.)
  2. Export behavior:

    • Respects active filters (provider, status, date range, search, error type)
    • Exports all matching records, not just the current page
    • Transactions tab exports transaction summaries; Failures tab exports failure entries
  3. UI placement:

    • An "Export" button in the toolbar of each tab (next to the refresh button)
    • Format selector (CSV / JSON) — either a dropdown or a small dialog

Implementation Notes

  • Backend: The filtering logic in src/proxy_app/api/logs.py (list_transactions, list_failures) already handles all filter parameters. An export endpoint could reuse this logic with a larger/unlimited page size, or stream results as CSV/JSON directly via a StreamingResponse.
  • Frontend: webui/src/pages/Logs.tsx — add an export button to the TransactionBrowser and FailureBrowser toolbars. The webui/src/api/logs.ts client would need a new function to call the export endpoint and trigger a browser download.
  • Owning commits (for fixup! targeting when implemented):
    • Backend viewer code → feat(tui): transaction viewer, compact displays, and detail views
    • WebUI code → feat(webui): add React web UI with admin dashboard, quota viewer, log explorer, and settings

Use Cases

  • Sharing error logs with upstream providers for debugging
  • Analyzing token usage / cost patterns offline in a spreadsheet
  • Archiving failure records for post-mortem review
  • Auditing transaction history over a date range

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions