mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 18:57:39 -07:00
Trim added to LogProvider.
TrimLogsJob added to trim the logs every 24 hours.
This commit is contained in:
parent
76114cf778
commit
b02c7066ad
4 changed files with 65 additions and 0 deletions
|
@ -46,5 +46,11 @@ namespace NzbDrone.Core.Instrumentation
|
|||
_database.Delete<Log>("");
|
||||
Logger.Info("Cleared Log History");
|
||||
}
|
||||
|
||||
public void Trim()
|
||||
{
|
||||
_database.Delete<Log>("WHERE Time < @0", DateTime.Now.AddDays(-30).Date);
|
||||
Logger.Info("Logs have been trimmed, events older than 30 days have been removed");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue