mirror of
https://github.com/netbirdio/docs.git
synced 2026-05-22 17:07:57 -07:00
Correct corruption
This commit is contained in:
@@ -96,9 +96,9 @@ a [github issue](https://github.com/netbirdio/netbird/issues/new/choose) and att
|
||||
|
||||
### Log rotation
|
||||
|
||||
NetBird rotates `client.log` itself by default — old files are written next to the active log as gzipped archives (e.g. `client-2025-04-01T12-00-00.000.log.gz`). The maximum size of the active file is controlled by [`NB_LOG_MAX_SIZE_MB`](/client/environment-variables#logging) (default: 15 MB).
|
||||
NetBird rotates `client.log` itself by default, old files are written next to the active log as gzipped archives (e.g. `client-2025-04-01T12-00-00.000.log.gz`). The maximum size of the active file is controlled by [`NB_LOG_MAX_SIZE_MB`](/client/environment-variables#logging) (default: 15 MB).
|
||||
|
||||
Running NetBird's built-in rotation **and** the `logrotate` service for Linux on the same file causes problems: `logrotate` renames the file out from under the daemon, and the daemon keeps writing to the old file, so new entries land in the rotated file instead of `client.log` or corruption happens.
|
||||
Running NetBird's built-in rotation **and** the `logrotate` service for Linux on the same file causes problems: `logrotate` renames the file out from under the daemon, and the daemon keeps writing to the old file. This results in `client.log` being corrupted with zero bytes and some logging lost.
|
||||
|
||||
To avoid this, NetBird scans `/etc/logrotate.conf` and `/etc/logrotate.d/*` on Linux startup. If any non-comment line mentions `netbird`, the client logs a warning and disables its own rotation, letting `logrotate` own the file. You will see a line like this in `client.log`:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user