log: add size-based log file rotation (#2682)

Signed-off-by: EisenbergD <dominik.eisenberg@beiersdorf.com>
Co-authored-by: EisenbergD <dominik.eisenberg@beiersdorf.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Dominik Eisenberg
2026-10-15 16:40:05 +00:00
committed by GitHub
co-authored by EisenbergD Claude Opus 5.5
parent 6e242d7af2
commit 5a7f8b5bd3
11 changed files with 1299 additions and 15 deletions
+3
View File
@@ -97,6 +97,9 @@ windows_exporter accepts flags to configure certain behaviours. The ones configu
| `--web.config.file` | A [web config][web_config] for setting up TLS and Auth | None |
| `--config.file` | [Using a config file](#using-a-configuration-file) from path | None |
| `--log.file` | Output file of log messages. One of [stdout, stderr, eventlog, \<path to log file>]<br>**NOTE:** The MSI installer will add a default argument to the installed service setting this to eventlog | stderr |
| `--log.rotation.max-size` | Size in megabytes at which the log file is rotated. Requires `--log.file` to be a path. If another process holds the file open without delete sharing, the exporter keeps writing to it and retries the rotation every minute. A moved or deleted log file is recreated within a minute. | `0` (off) |
| `--log.rotation.max-backups` | Number of rotated log files to keep. `0` keeps all. | `0` |
| `--log.rotation.compress` | Compress rotated log files with gzip. | `false` |
## Installation