From 18bed6289d26a293eb75f740df7ecd546d02d5fe Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Tue, 25 May 2021 21:41:21 +0200 Subject: [PATCH] Fixed http log file census for probing. --- .../statoolinfos/metrics/http/HttpErrorLogAnalyzer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fr/devinsy/statoolinfos/metrics/http/HttpErrorLogAnalyzer.java b/src/fr/devinsy/statoolinfos/metrics/http/HttpErrorLogAnalyzer.java index d8167c9..9de0e41 100644 --- a/src/fr/devinsy/statoolinfos/metrics/http/HttpErrorLogAnalyzer.java +++ b/src/fr/devinsy/statoolinfos/metrics/http/HttpErrorLogAnalyzer.java @@ -26,6 +26,7 @@ import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -218,7 +219,7 @@ public class HttpErrorLogAnalyzer String prefix = source.substring(0, source.length() - 1); for (File file : new File(prefix).getParentFile().listFiles()) { - if (file.getName().startsWith(prefix)) + if (file.getName().startsWith(FilenameUtils.getName(prefix))) { analyzer.probe(file); }