mirror of
https://github.com/zadam/trilium.git
synced 2025-10-09 23:18:46 +08:00
feat(logs): provide an option to keep all logs
This commit is contained in:
parent
384a89b0e3
commit
3ba487bb00
2 changed files with 10 additions and 1 deletions
|
@ -38,6 +38,9 @@ async function cleanupOldLogFiles() {
|
||||||
const customRetentionDays = config.Logging.retentionDays;
|
const customRetentionDays = config.Logging.retentionDays;
|
||||||
if (customRetentionDays > 0) {
|
if (customRetentionDays > 0) {
|
||||||
retentionDays = customRetentionDays;
|
retentionDays = customRetentionDays;
|
||||||
|
} else if (customRetentionDays <= -1){
|
||||||
|
info(`Log cleanup: keeping all log files, as specified by configuration.`);
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const cutoffDate = new Date();
|
const cutoffDate = new Date();
|
||||||
|
|
|
@ -24,5 +24,11 @@ retentionDays=7
|
||||||
|
|
||||||
Or via the environment variable `TRILIUM_LOGGING_RETENTION_DAYS`.
|
Or via the environment variable `TRILIUM_LOGGING_RETENTION_DAYS`.
|
||||||
|
|
||||||
|
Special cases:
|
||||||
|
|
||||||
|
* Positive values indicate the number of days worth of logs to keep
|
||||||
|
* A value of 0 results with the default value (90 days) to be used
|
||||||
|
* Negative values (e.g. `-1`) result with all logs to be kept, irrespective how ancient and numerous (and
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> If you set the retention days to a low number, you might notice that not all the log files are being deleted. This is because a minimum number of logs (7 at the time of writing) is maintained at all times.
|
> If you set the retention days to a low number, you might notice that not all the log files are being deleted. This is because a minimum number of logs (7 at the time of writing) is maintained at all times.
|
Loading…
Add table
Reference in a new issue