Skip to content

Add streaming/tailing variants of log readers #73

Open

Description

@claytoncollie

Problem

read_error_log and read_access_log are point-in-time reads. For "make a change, hit the page, see what got logged" feedback loops, agents currently have to re-read the whole file each time. A cursor-based tail-with-offset pattern would let agents incrementally consume new log lines as they appear, turning one-shot code generation into an actual debugging loop.

Proposal

  • tail_error_log(siteId?, sinceCursor?, maxLines?) → returns new lines since sinceCursor plus a new cursor token
  • tail_access_log(siteId?, sinceCursor?, maxLines?) → same shape

Cursor is opaque to the client — implementation can be byte offset, last-line hash, or whatever is robust against log rotation.

Acceptance criteria

  • Successive calls with the returned cursor return only new lines
  • Handles log rotation gracefully (resets cursor, includes a flag indicating rotation occurred)
  • maxLines defaults to a sane value to avoid context blowups
  • First call without a cursor returns the most recent N lines plus a cursor for the next call
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions