feat(logs): log level, retention, size limits and rotation on server and desktop

Owner review 2, R11 asked for more log settings. The file sink now writes daily or
hourly files, continues a full file in numbered parts and prunes by age and by the
total size (never the file being written); its options change while it runs.

Server: the file and console levels are separate and read by the logging filters
at every line, so the admin panel's new Logs group applies without a restart; the
engine's level follows the lower of the two. This also fixes a bug: the file logger
was fixed at Information, so CHRONOS_LOG_LEVEL=Debug or Trace never reached the
files. New variables CHRONOS_LOG_CONSOLE_LEVEL, CHRONOS_LOG_RETENTION_DAYS,
CHRONOS_LOG_MAX_FILE_MB, CHRONOS_LOG_MAX_TOTAL_MB, CHRONOS_LOG_ROTATION,
CHRONOS_AUDIT_RETENTION_DAYS and CHRONOS_DIAGNOSTICS_LOG_MB lock their settings like
the others; the diagnostics zip keeps the configured share of each log.

Desktop: Settings > Advanced gains Log level, Keep logs, File size, Logs total,
Rotation and Diagnostics logs, applied at every save; Advanced's Reset section
restores them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit cc875784e4952ee0e4c807b9d9c18496d3d5a8c3)
This commit is contained in:
Alby96 committed 2026-10-27 02:08:09 +01:00
1 parent 1f089888e8
commit 0e84392f4f
35 files changed
+1485 -119

No files matched your search

+6
View File
@@ -556,6 +556,7 @@
<data name="Tooltips.Settings.DeepAfterScan" xml:space="preserve"><value>Anche le sequenze trovate da una scansione (cartelle adottate, nuovi sidecar) ricevono l'analisi profonda, in background</value></data>
<data name="Tooltips.Settings.DefaultServer" xml:space="preserve"><value>Server a cui Chronos si connette all'avvio; cambiarlo chiude l'accesso · Invio applica, Esc annulla</value></data>
<data name="Tooltips.Settings.Diagnostics" xml:space="preserve"><value>Comprime log, rapporto su sistema e codec, impostazioni e attività fallite di recente in una cartella a tua scelta; password, token e foto restano fuori</value></data>
<data name="Tooltips.Settings.DiagnosticsLogs" xml:space="preserve"><value>Quanta parte finale di ogni file di log include il pacchetto di diagnostica</value></data>
<data name="Tooltips.Settings.EarlierData" xml:space="preserve"><value>Apri i dati che questa copia portatile teneva accanto a sé prima di trovarsi in OneDrive. Chronos non li usa più e li lascia com'erano</value></data>
<data name="Tooltips.Settings.Export" xml:space="preserve"><value>Salva tutte le impostazioni in JSON, senza il token di sessione</value></data>
<data name="Tooltips.Settings.FileTemplate" xml:space="preserve"><value>Nome del file di ogni fotogramma, ad esempio {date}_{time}_{n:0000}; l'estensione viene aggiunta · Invio applica, Esc annulla</value></data>
@@ -567,9 +568,13 @@
<data name="Tooltips.Settings.KeepArchiveSettings" xml:space="preserve"><value>Lascia le impostazioni dell'archivio come sono</value></data>
<data name="Tooltips.Settings.KeepCache" xml:space="preserve"><value>Lascia la cache com'è</value></data>
<data name="Tooltips.Settings.KeepIndex" xml:space="preserve"><value>Lascia l'indice com'è</value></data>
<data name="Tooltips.Settings.KeepLogs" xml:space="preserve"><value>I file di log scritti l'ultima volta prima di questo periodo vengono eliminati</value></data>
<data name="Tooltips.Settings.KeepSettings" xml:space="preserve"><value>Lascia ogni impostazione com'è</value></data>
<data name="Tooltips.Settings.Language" xml:space="preserve"><value>Lingua dell'interfaccia · si applica subito</value></data>
<data name="Tooltips.Settings.LogFileSize" xml:space="preserve"><value>Un file di log che raggiunge questa dimensione prosegue in un nuovo file numerato</value></data>
<data name="Tooltips.Settings.LogLevel" xml:space="preserve"><value>Livello minimo scritto nei file di log; Debug e Trace aiutano a trovare i problemi ma riempiono i file in fretta</value></data>
<data name="Tooltips.Settings.LogsFolder" xml:space="preserve"><value>File di log giornalieri, conservati per 14 giorni</value></data>
<data name="Tooltips.Settings.LogsTotal" xml:space="preserve"><value>Quando i file di log insieme superano questa dimensione, i più vecchi vengono eliminati, mai quello in scrittura</value></data>
<data name="Tooltips.Settings.Memory" xml:space="preserve"><value>I fotogrammi restano in memoria fino a questo limite, poi passano nella cartella della cache</value></data>
<data name="Tooltips.Settings.MemoryAuto" xml:space="preserve"><value>Auto: un quarto della memoria installata</value></data>
<data name="Tooltips.Settings.MemoryReset" xml:space="preserve"><value>Torna ad Auto: un quarto della memoria installata</value></data>
@@ -609,6 +614,7 @@
<data name="Tooltips.Settings.RestoreCancel" xml:space="preserve"><value>Tieni l'indice attuale al prossimo avvio</value></data>
<data name="Tooltips.Settings.RestoreConfirm" xml:space="preserve"><value>Al prossimo avvio di Chronos, salva una copia dell'indice attuale e poi ripristina questa copia</value></data>
<data name="Tooltips.Settings.RestorePending" xml:space="preserve"><value>La copia scelta sostituisce l'indice al prossimo avvio di Chronos</value></data>
<data name="Tooltips.Settings.Rotation" xml:space="preserve"><value>Inizia un nuovo file di log ogni giorno o ogni ora (UTC)</value></data>
<data name="Tooltips.Settings.Search" xml:space="preserve"><value>Trova un'impostazione per nome</value></data>
<data name="Tooltips.Settings.SelfTest" xml:space="preserve"><value>Codifica una breve clip sintetica con ogni encoder e ne riporta esito e velocità · circa un minuto</value></data>
<data name="Tooltips.Settings.SelfTestResult" xml:space="preserve"><value>Velocità sulla clip di prova sintetica 1280×720</value></data>