Skip to content

Add sm tail log viewer (Pail-equivalent) #173

@antosubash

Description

@antosubash

Background

There is no built-in way to tail logs from the CLI in a developer-friendly format. Devs either use tail -f on the Serilog file (verbose, hard to filter) or rely on the IDE console. Laravel Pail provides a pretty, filterable, real-time log viewer.

Motivation

  • One command to see what the running app is doing
  • Filter by level, message, user, request-id without grep gymnastics
  • Works against local file sink and a running process

Design sketch

New CLI command sm tail:

  • Reads the configured Serilog file sink (or stdin if piped)
  • Pretty-prints with color: timestamp, level, source, message, scoped properties
  • Flags:
    • --level Error (filter by min level)
    • --filter "user:42" (substring on properties)
    • --source MyModule.SomeClass (logger name match)
    • --user 42 (UserId property filter)
    • --request <id> (RequestId property filter)
    • --json (raw JSON pass-through, for piping)
  • Follow mode by default; --no-follow for one-shot
  • Multi-file: if running against the AppHost orchestrator, merges streams by timestamp and labels each line with its source

Implementation: parse Serilog Compact JSON formatter output (renderedCompactJson); fall back to plain-text log files with regex.

Acceptance criteria

  • sm tail command in cli/SimpleModule.Cli
  • Color output respecting NO_COLOR
  • All listed filter flags
  • Multi-file merged tail mode
  • xUnit tests for parser + filter logic
  • Docs page with screenshot

References

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions