fix(logs): apply log settings from the first line and name the locking variable
The desktop opened its log files with the default limits and wrote its first line, which prunes, before Settings › Advanced › Logs were applied. Every start, and every launch that only hands its file to the running Chronos, deleted logs older than 14 days and cut the folder to 1 GB whatever the user kept. AppLogging.Open now builds the sink from the stored settings before that line; the settings are read again once the launch owns the data folder. A total below one file deleted each finished file as the next one opened. The rule now lives in LogFileOptions.TotalBelowFile: the server keeps refusing it, the desktop raises the total to the file size and its rows no longer offer the combination. The desktop log rows threw on negative sizes from an imported or hand-edited file and showed raw values the files never got; they now show the applied ones. Upgraded Unraid and compose installs keep CHRONOS_LOG_LEVEL=Information, which locks both levels. The lock stays; the server now reports which variable fixes each locked setting (LockedBy), so the panel's tooltip names it exactly and says to remove it to change the value there. The releases README tells upgraders. The former-constructor log test no longer fails across midnight UTC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 8ba7162bd5926d34c5ec4e40e2a2dad063ee19c3)
This commit is contained in:
1 parent
8d66be709c
commit
ac121acf7c
53 files changed
+254
-92
No files matched your search
@@ -149,8 +149,7 @@ public sealed class ServerLogging
|
||||
{
|
||||
if (retentionDays is < 1 or > MaxRetentionDays) return nameof(ServerOptions.LogRetentionDays);
|
||||
if (maxFileMb is < 0 or > MaxFileMb) return nameof(ServerOptions.LogMaxFileMb);
|
||||
// A total below one file would delete every finished file at once.
|
||||
if (maxTotalMb is < 0 or > MaxTotalMb || (maxTotalMb > 0 && maxFileMb > maxTotalMb)) return nameof(ServerOptions.LogMaxTotalMb);
|
||||
if (maxTotalMb is < 0 or > MaxTotalMb || LogFileOptions.TotalBelowFile(maxFileMb, maxTotalMb)) return nameof(ServerOptions.LogMaxTotalMb);
|
||||
if (auditRetentionDays is < 0 or > MaxAuditRetentionDays) return nameof(ServerOptions.AuditRetentionDays);
|
||||
if (diagnosticsLogMb is < 1 or > MaxDiagnosticsLogMb) return nameof(ServerOptions.DiagnosticsLogMb);
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user