You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This introduces a configurable native size/time log rotation & deletion
functionality. It updates the `ServerLogger` to track file size and age
internally, triggering rotation at a default size of 50MB or 24 hours,
if the config values `max_size_mb`/`rotation_interval_hours` are unset.
We keep only `max_files` (defaults to 5) rotated log files at a time,
deleting older log files.
We also now allow users to turn off logging to file, but the default is
logging to file and stdout/stderr. Internal rotation can be disabled for
file logging by setting the `max_size_mb` and `rotation_interval_hours`
params to `0`.
Co-Authored-By: Gemini 3.0 Pro
Copy file name to clipboardExpand all lines: docs/operations.md
+12-7Lines changed: 12 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,18 @@ The server handles `SIGTERM` and `CTRL-C` (SIGINT). On receipt, it:
21
21
22
22
### Log Rotation
23
23
24
-
> **Important:** LDK Server does not rotate or truncate its own log file. Without log rotation
25
-
> configured, the log file will grow indefinitely and can eventually fill your disk. A full
26
-
> disk can prevent the node from persisting channel state, risking fund loss.
27
-
28
-
The server reopens its log file on `SIGHUP`. This integrates with standard `logrotate`. Save
29
-
the following config to `/etc/logrotate.d/ldk-server` (adjust the log path to match your
30
-
setup):
24
+
By default, LDK Server logs to `stdout`/`stderr` and also to file. When running under `systemd` or Docker,
25
+
this allows the environment (e.g., `journald`) to handle persistence, rotation, and
26
+
compression automatically.
27
+
28
+
If you enable `log_to_file` in the configuration, LDK Server writes logs to the configured file while still
29
+
keeping the stdin/stdout logs available too. Logs files are automatically rotated at `max_size_mb` or `rotation_interval_hours`, and the last `max_files` uncompressed log files are retained. But you can disable
30
+
the internal rotation and keep logging to file by setting the `max_size_mb` and `rotation_interval_hours`
31
+
params to `0`.
32
+
33
+
If you prefer to use system `logrotate` for file logs, the server still reopens its log
34
+
file on `SIGHUP`. Save the following config to `/etc/logrotate.d/ldk-server`
0 commit comments