This commit is contained in:
Mateusz Gruszczyński committed 2026-11-23 23:03:30 +01:00
1 parent 96eec3b1c6
commit b9a5b3c153
30 files changed
+1100 -374

No files matched your search

+38 -1
View File
@@ -22,6 +22,43 @@ Live viewing is **bounded in memory**. Slow consumers may receive a gap/loss ind
The authenticated **Logs → Stored logs** page reads the configured structured JSON/JSONL access logs, optional per-Vhost files and optional error log. These files can remain readable even when their current writer is disabled. The explorer supports paging, dynamic columns, sorting, record expansion/Raw JSON and repeated-value analysis.
How to use it (0.41.1):
- **Source** lists one entry per log, grouped as *Vhosts*, *Redirect hosts*, *404 hosts*, *Other traffic* (`_unmatched`), *Shared access log* and *Error log*. A log includes all its rotations.
- **File** narrows a log to one file: the current file, `.1`, `.2.gz`, … Rotations are always ordered by their number (newest data first), not by file modification time, so a touched or copied `.10.gz` no longer appears first. Uncompressed rotations (`.1` with logrotate `delaycompress`) are included.
- A log is read **newest first**: the current file may use the whole scan budget, and older rotations are read only while budget remains. The status line shows the range of matching records, which files were read and, if older files were left out, how to browse them (choose the file).
- **Period** (15 minutes … 7 days) filters by record time and stops before rotations that are entirely older. **Status chips** filter 2xx/3xx/4xx/5xx or protocol errors on the server.
- **Search syntax** opens as a panel under the search field (also on phones); tap an example to use it. **← Newer / Older →** page through the results.
### Per-site files and rotation
With **per-Vhost access logs** enabled, every site has its own file in the configured directory:
| File | Traffic |
|---|---|
| `<vhost>.jsonl` | requests handled by a Vhost |
| `<id>.redirect.jsonl` | requests answered by a redirect host (records carry `redirect_host`) |
| `<id>.host404.jsonl` | requests answered by a local 404 host (records carry `local_host`) |
| `_unmatched.jsonl` | requests for hosts that match nothing |
Before 0.41.1 redirect and 404 hosts were logged to `_unmatched.jsonl` (or the shared file). The extra fields are omitted for other records, so existing parsers are unaffected.
RustProxy now notices external rotation: about once per second it checks whether the configured path still names the open file and reopens it after `logrotate` (`create` mode), `mv` or deletion. A standard policy is enough — no `postrotate` signal and no `copytruncate` is needed:
```text
/var/log/rustproxy/*.jsonl /var/log/rustproxy/vhosts/*.jsonl /var/log/rustproxy/error.log {
daily
rotate 14
compress
delaycompress
missingok
notifempty
create 0600 rustproxy rustproxy
}
```
`delaycompress` keeps the last rotation uncompressed for the second during which RustProxy may still finish a write to it. Earlier versions kept writing into the renamed (and, after compression, deleted) file until a restart, so records written after a rotation could be missing from disk; restart the service once after upgrading if you rotate logs externally.
Search uses a restricted case-insensitive query syntax, for example:
```text
@@ -48,7 +85,7 @@ For common symptoms:
- **502/503/504:** correlate request ID, Vhost and backend health with upstream timeout/connect/TLS errors.
- **403/405/429:** inspect ACL, method rule, country or rate limiting.
- **Unexpected cache result:** inspect optional `X-Cache` diagnostics and Cache dashboard alongside request logs.
- **Files empty:** enable the correct sink and check permissions, path and rotation state.
- **Files empty:** enable the correct sink and check permissions, path and rotation state. If only old rotations hold data (e.g. the newest records are in `.10.gz` and the current file stays empty), the service was running a version older than 0.41.1 during a rotation; restart it once.
- **Protocol failures missing from Live Logs:** inspect configured persistent error/protocol logs instead.
Also see [Monitoring](MONITORING.md) and [Troubleshooting](TROUBLESHOOTING.md).