Codescribe
33a5480072
Add log tail command for live log streaming
...
This commit adds a new `ctrld log tail` subcommand that streams
runtime debug logs to the terminal in real-time, similar to `tail -f`.
Changes:
- log_writer.go: Add Subscribe/tailLastLines for fan-out to tail clients
- control_server.go: Add /log/tail endpoint with streaming response
- Internal logging: subscribes to logWriter for live data
- File-based logging: polls log file for new data (200ms interval)
- Sends last N lines as initial context on connect
- commands.go: Add `log tail` cobra subcommand with --lines/-n flag
- control_client.go: Add postStream() with no timeout for long-lived connections
Usage:
sudo ctrld log tail # shows last 10 lines then follows
sudo ctrld log tail -n 50 # shows last 50 lines then follows
Ctrl+C to stop
2026-03-23 16:41:54 +07:00
..
2024-02-07 14:40:18 +07:00
2025-10-09 17:49:21 +07:00
2026-03-05 17:24:01 +07:00
2026-03-05 17:24:01 +07:00
2025-02-18 20:25:13 +07:00
2024-08-07 15:51:11 +07:00
2026-03-10 17:13:33 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 19:12:06 +07:00
2026-03-23 16:41:54 +07:00
2026-03-10 17:13:33 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 18:47:18 +07:00
2025-10-09 18:47:18 +07:00
2026-03-10 17:13:33 +07:00
2025-10-09 18:47:18 +07:00
2025-10-09 18:47:18 +07:00
2025-10-09 18:47:18 +07:00
2026-03-10 17:13:33 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 19:12:06 +07:00
2026-03-23 16:41:54 +07:00
2023-08-15 18:22:38 +07:00
2026-03-23 16:41:54 +07:00
2026-03-10 17:42:45 +07:00
2026-03-10 17:42:45 +07:00
2026-03-10 17:13:33 +07:00
2026-03-10 17:42:43 +07:00
2026-03-05 17:24:03 +07:00
2026-03-10 17:13:33 +07:00
2024-10-24 13:05:48 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 20:51:12 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 19:12:06 +07:00
2026-03-23 16:41:54 +07:00
2025-10-09 19:12:06 +07:00
2026-03-23 16:41:54 +07:00
2023-12-13 14:53:29 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 17:49:21 +07:00
2026-03-10 17:13:33 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 17:46:02 +07:00
2025-10-09 19:12:06 +07:00
2025-02-18 20:25:13 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 19:12:06 +07:00
2023-08-15 18:22:38 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 17:49:21 +07:00
2024-05-09 18:39:30 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 17:49:21 +07:00
2026-03-10 17:13:33 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 17:46:02 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 17:46:02 +07:00
2025-10-09 19:12:06 +07:00
2025-05-15 17:00:59 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 19:12:06 +07:00
2025-03-26 23:18:36 +07:00
2025-03-26 23:18:36 +07:00
2025-10-09 17:49:21 +07:00
2026-03-10 17:13:33 +07:00
2026-03-10 17:13:33 +07:00
2026-03-10 17:13:33 +07:00
2025-10-09 17:49:21 +07:00
2025-03-26 23:18:04 +07:00
2025-10-09 17:49:21 +07:00
2025-10-09 19:12:06 +07:00
2025-10-09 19:12:06 +07:00
2026-03-10 17:18:23 +07:00
2024-02-07 14:40:18 +07:00