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
References
Background
There is no built-in way to tail logs from the CLI in a developer-friendly format. Devs either use
tail -fon the Serilog file (verbose, hard to filter) or rely on the IDE console. Laravel Pail provides a pretty, filterable, real-time log viewer.Motivation
Design sketch
New CLI command
sm tail:--level Error(filter by min level)--filter "user:42"(substring on properties)--source MyModule.SomeClass(logger name match)--user 42(UserIdproperty filter)--request <id>(RequestIdproperty filter)--json(raw JSON pass-through, for piping)--no-followfor one-shotImplementation: parse Serilog Compact JSON formatter output (
renderedCompactJson); fall back to plain-text log files with regex.Acceptance criteria
sm tailcommand incli/SimpleModule.CliNO_COLORReferences