mirror of
https://github.com/gethomepage/homepage.git
synced 2026-10-15 15:09:56 -07:00
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
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:
@@ -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`:
|
||||||
|
|||||||
@@ -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,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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 () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user