From 316d22aecd52e17e352b97b1c48854966ec7c3e3 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Thu, 18 Jul 2024 18:19:21 +0200 Subject: [PATCH] Fixed sort command output. --- src/fr/devinsy/logar/app/log/LogFile.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fr/devinsy/logar/app/log/LogFile.java b/src/fr/devinsy/logar/app/log/LogFile.java index 31e4e3b..00ca9cf 100644 --- a/src/fr/devinsy/logar/app/log/LogFile.java +++ b/src/fr/devinsy/logar/app/log/LogFile.java @@ -26,6 +26,7 @@ import java.io.PrintWriter; import java.util.zip.GZIPOutputStream; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -238,7 +239,7 @@ public final class LogFile PrintWriter out = null; try { - if (target.getName().endsWith(".gz")) + if (StringUtils.endsWithAny(target.getName(), ".gz", ".gz.tmp")) { out = new PrintWriter(new GZIPOutputStream(new FileOutputStream(target))); }