more lenient log file detection

This commit is contained in:
Govindas 2021-06-13 12:30:35 +03:00
parent b27f7c6c2d
commit 402ad7c897
2 changed files with 8 additions and 1 deletions

View File

@ -45,7 +45,8 @@ public class AutomaticLogDeleter extends JavaPlugin {
fileName = file.getName();
//if file is not a log file
if (!fileName.endsWith(".log") && !fileName.endsWith(".log.gz")) {
//using contains to make it more likely to catch different types of logging systems
if (!fileName.contains(".log")) {
continue;
}

View File

@ -11,3 +11,9 @@ delete-logs-older-than-seconds: 86400
#default value: false
also-delete-logs-on-shutdown: false
#list of directories to check for logs
#note it will only delete files that contain ".log" in their name for safety reasons
#not yet implemented
check-directories-for-logs:
- "logs"