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
feat(logging): add log rotation and transition default server posture to stdout/stderr
Introduce thread-safe log rotation via RotatingFileSink and transition direct lemond executions to console-first logging with optional rotating file logging.
- Implement RotatingFileSink with size-triggered rotation, max_files backup retention, excess backup pruning, backup slot fallback, and in-place truncation for max_files=0.
- Add configuration settings log_max_file_size_mb (1..2048) and log_max_files (0..100) with 64-bit validation across CLI, RuntimeConfig, and config.json.
- Support --log-file, --log-max-size-mb, and --log-max-files CLI overrides as in-memory runtime parameters without mutating persistent config.
- Add comprehensive C++ unit test suite (test_log_rotation) and Python integration suite (test/server_log_rotation.py).
Copy file name to clipboardExpand all lines: docs/dev/getting-started.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -826,7 +826,7 @@ The tray application provides a system tray icon for desktop users:
826
826
### Logging and Console Output
827
827
828
828
When running `LemonadeServer.exe` or `lemond`:
829
-
- **Log File:** Direct runs write logs to a persistent log file (default: `%TEMP%\lemonade-server.log` on Windows). When `lemond` runs as the systemd service, logs go to the journal instead.
829
+
- **Log File:** Direct CLI server runs (`lemond`) default to standard console output (`stdout`/`stderr`) with file logging disabled (`"auto"` mode), allowing systemd, launchd, container runtimes, and CI runners to capture and rotate logs natively. When running via `LemonadeServer.exe` (embedded tray app) or when file logging is explicitly enabled (`--log-file enabled` or a custom file path), logs are written to `lemonade-server.log` (under `%TEMP%` on Windows, `$XDG_RUNTIME_DIR/lemonade/` on Linux) with automatic log rotation (10 MB file cap, 5 rotated backups `.1` through `.5`, bounding steady-state log disk usage to ~60 MB under normal record sizes). Pre-existing legacy logs at startup are rotated into `.1` to preserve diagnostic history and pruned across subsequent rotation cycles.
830
830
- **Logs UI:** Click "Show Logs" in the tray or use `lemonade logs` to open the desktop app's logs view
831
831
- Connects to the server's WebSocket log stream
832
832
- Shows retained recent log history plus live entries
|`log_file`| string | "auto" | File logging mode: "auto" (console-only for direct server runs, lemonade-server.log for embedded tray app), "disabled", "enabled", or custom target file path |
195
+
|`log_max_file_size_mb`| int | 10 | Max active log file size in MB before triggering rotation (steady-state footprint bounded to ~`log_max_file_size_mb * (log_max_files + 1)`) |
196
+
|`log_max_files`| int | 5 | Max number of rotated log backup files to retain (.1 through .N); legacy oversized files are rotated into .1 and pruned over cycles |
191
197
|`global_timeout`| int | 600 | Timeout in seconds for HTTP, inference, and readiness checks |
192
198
|`max_loaded_models`| int | 1 | Max models per type slot. Use -1 for unlimited |
193
199
|`broadcast`| bool | true | Enable or disable UDP broadcasting for server discovery |
0 commit comments