logfire-read

📁 michaeltschreiber/logger 📅 3 days ago
2
总安装量
2
周安装量
#73847
全站排名
安装命令
npx skills add https://github.com/michaeltschreiber/logger --skill logfire-read

Agent 安装分布

opencode 2
gemini-cli 2
claude-code 2
github-copilot 2
codex 2
kimi-cli 2

Skill 文档

Logfire Read Skill

Use this skill to read Logfire records with JSONL output using the repo’s reader utilities.

Quick Start

  1. Load .env from the repo root:
set -a
. ./.env
set +a
  1. Run the JSONL reader:
python scripts/logfire-fetch.py

Or use the bundled script:

./.codex/skills/logfire-read/scripts/read_logs.sh --message-like "Processing failed" --limit 10

Agent-Friendly CLI

Use the agent helper for targeted queries:

python scripts/logfire-read-agent.py --since 2026-01-11T00:00:00Z --message-like "Processing failed" --limit 10

Module API

Use query_logfire() for programmatic access:

from logger import query_logfire

rows = query_logfire(jsonl=True, level=21, message_like="Processing failed", limit=10)
for row in rows:
    print(row)

Environment Variables

Required:

  • LOGFIRE_READ_URL (e.g., https://logfire-us.pydantic.dev/v1/query)
  • LOGFIRE_READ_TOKEN

Optional filters:

  • LOGFIRE_READ_COLUMNS
  • LOGFIRE_READ_LIMIT
  • LOGFIRE_READ_SINCE
  • LOGFIRE_READ_LEVEL
  • LOGFIRE_READ_MESSAGE_LIKE
  • LOGFIRE_READ_TRACE_ID
  • LOGFIRE_READ_SPAN_ID
  • LOGFIRE_READ_JSONL=true

Output Format

  • JSONL output returns one JSON object per record.
  • level is converted to severity strings (trace, debug, info, warn, error, fatal).