Skip to content

feat(cli): add sm tail log viewer (closes #173)#205

Open
antosubash wants to merge 1 commit into
mainfrom
issue-173-sm-tail
Open

feat(cli): add sm tail log viewer (closes #173)#205
antosubash wants to merge 1 commit into
mainfrom
issue-173-sm-tail

Conversation

@antosubash
Copy link
Copy Markdown
Owner

Summary

Adds sm tail — a Pail-equivalent CLI for tailing logs from stdin or files.

  • Auto-detects JSON-per-line (Serilog compact + .NET JsonConsoleFormatter) vs plain text
  • Filters by level / substring / source / user / request id
  • Follow mode is the default; --no-follow for one-shot reads
  • Color output respects NO_COLOR and is auto-disabled when stdout is redirected

Scope notes

  • Framework doesn't ship a Serilog config — designed around stdin pipe (dotnet run | sm tail) and file paths
  • AppHost orchestrator multi-file merged-by-timestamp tail is documented as future work

Test plan

  • dotnet test tests/SimpleModule.Cli.Tests -p:IsTestProject=true --filter "FullyQualifiedName~Tail" passes
  • dotnet build clean (TreatWarningsAsErrors)
  • Manual: echo '{"@t":"2026-01-01T00:00:00","@l":"Error","@m":"boom"}' | sm tail
  • Manual: sm tail --file logs/app.log --level Warning --filter checkout

- New tail command reads stdin or --file paths
- JSON-aware (Serilog compact + .NET JsonConsoleFormatter) with plain-text fallback
- Filters: --level --filter --source --user --request --json
- Follow mode (default) with --no-follow for one-shot reads
- Multi-file mode prefixes each line with [filename]
- Honors NO_COLOR and output redirection
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 15, 2026

Deploying simplemodule-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5062464
Status: ✅  Deploy successful!
Preview URL: https://780ccefb.simplemodule-website.pages.dev
Branch Preview URL: https://issue-173-sm-tail.simplemodule-website.pages.dev

View logs

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant