Chorehancement: limit log size + rotate (#7218)
Docker CI / Docker Build & Push (push) Canceled after 0s
Lint / Linting Checks (push) Canceled after 0s
Release Drafter / Update Release Draft (push) Canceled after 0s
Release Drafter / Auto Label PR (push) Canceled after 0s
Tests / vitest (1) (push) Canceled after 0s
Tests / vitest (2) (push) Canceled after 0s
Tests / vitest (3) (push) Canceled after 0s
Tests / vitest (4) (push) Canceled after 0s

This commit is contained in:
shamoon
2026-10-05 21:21:25 -07:00
committed by GitHub
parent 8ec79250e6
commit 904e895fec
3 changed files with 8 additions and 0 deletions
+2
View File
@@ -612,6 +612,8 @@ logpath: /logfile/path
By default, logs are sent both to `stdout` and to a file at the path specified. This can be changed by setting the `LOG_TARGETS` environment variable to one of `both` (default), `stdout` or `file`. By default, logs are sent both to `stdout` and to a file at the path specified. This can be changed by setting the `LOG_TARGETS` environment variable to one of `both` (default), `stdout` or `file`.
Log files rotate automatically when they reach 10 MiB. Up to five files are retained: the current `homepage.log` and four rotated files (`homepage1.log` through `homepage4.log`). The oldest rotated file is removed when a new one is created.
## Show Container Stats ## Show Container Stats
You can show all docker or proxmox stats expanded in `settings.yaml`: You can show all docker or proxmox stats expanded in `settings.yaml`:
+3
View File
@@ -50,6 +50,9 @@ function getFileLogger() {
winston.format.printf(messageFormatter), winston.format.printf(messageFormatter),
), ),
filename: `${logpath}/logs/homepage.log`, filename: `${logpath}/logs/homepage.log`,
maxsize: 10 * 1024 * 1024,
maxFiles: 5,
tailable: true,
handleExceptions: true, handleExceptions: true,
handleRejections: true, handleRejections: true,
}); });
+3
View File
@@ -95,6 +95,9 @@ describe("utils/logger", () => {
const transports = state.lastCreateLoggerArgs.transports; const transports = state.lastCreateLoggerArgs.transports;
expect(transports).toHaveLength(1); expect(transports).toHaveLength(1);
expect(transports[0].opts.filename).toBe("/tmp/logs/homepage.log"); expect(transports[0].opts.filename).toBe("/tmp/logs/homepage.log");
expect(transports[0].opts.maxsize).toBe(10 * 1024 * 1024);
expect(transports[0].opts.maxFiles).toBe(5);
expect(transports[0].opts.tailable).toBe(true);
}); });
it("defaults to both transports for unknown LOG_TARGETS and patches console methods", async () => { it("defaults to both transports for unknown LOG_TARGETS and patches console methods", async () => {