mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-09-24 13:30:40 +01:00
Nginx Proxy Manager had no way to inspect application or nginx logs from the web UI - admins had to shell into the container or read `docker logs`. This adds an admin-only Logs page that can tail: - the backend application log, now also mirrored to /data/logs/backend.log (in addition to stdout) and rotated by the logrotate timer that already runs every 2 days - the Let's Encrypt/certbot log, which certbot already writes to /data/logs/letsencrypt.log via its existing --logs-dir flag - per-host nginx access/error logs (proxy, redirection, 404 and stream hosts), with the file path always resolved server-side from a validated host_type enum + numeric host_id, never from client input Reads use a reverse chunked scan (64KB chunks, capped at 5MB scanned per request) instead of loading whole files into memory, and the frontend polls every 5s only while the tab is focused and "Live" is on, so this stays cheap on both CPU and memory. No new runtime dependencies were added on either side. Purely additive: two new admin-only endpoints (GET /api/logs/sources, GET /api/logs/tail), no existing behaviour changed.
31 lines
785 B
JSON
31 lines
785 B
JSON
{
|
|
"type": "object",
|
|
"description": "The last N lines of a log source",
|
|
"required": ["lines", "size", "truncated", "exists"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"lines": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"example": ["2026-01-01T00:00:00.000Z INFO [Global ] Backend PID 1 listening on port 3000 ..."]
|
|
},
|
|
"size": {
|
|
"type": "integer",
|
|
"description": "Size in bytes of the underlying log file",
|
|
"example": 4096
|
|
},
|
|
"truncated": {
|
|
"type": "boolean",
|
|
"description": "True when the file is larger than the maximum amount of data scanned per request",
|
|
"example": false
|
|
},
|
|
"exists": {
|
|
"type": "boolean",
|
|
"description": "False when the underlying log file does not exist yet",
|
|
"example": true
|
|
}
|
|
}
|
|
}
|