Fixed log file pattern.

This commit is contained in:
Christian P. MOMON 2021-04-25 03:01:49 +02:00
parent d4d1b6038c
commit b7f9d875f1

View file

@ -47,7 +47,7 @@ public final class Logar
{
private static Logger logger = LoggerFactory.getLogger(Logar.class);
public static String LOGFILE_PATTERN = "^.+\\.(log|log\\.\\d+|log\\.gz|log\\.gz\\.\\d+)";
public static String LOGFILE_PATTERN = "^.+(\\.|_)(log|log\\.gz|log\\.\\d+|log\\.\\d+\\.gz)$";
/**
* Instantiates a new log tool.
@ -93,7 +93,7 @@ public final class Logar
anonymizer.loadMapTable(mapFile);
System.out.println("Table size=" + anonymizer.getMapTable().size());
Files files = FilesUtils.searchEndingWith(source, ".log", ".log.gz").keepFileType().removeContaining("-anon.log");
Files files = FilesUtils.searchEndingWith(source, ".log", ".log.gz").keepFileType().removeContaining("-anon.log").sortByName();
logger.info("file count={}", files.size());
for (File file : files)
{
@ -501,7 +501,7 @@ public final class Logar
*/
public static void testConcate(final File source)
{
Files files = FilesUtils.searchEndingWith(source, ".log", ".log.gz").keepFileType().removeContaining("-anon.log");
Files files = FilesUtils.searchEndingWith(source, ".log", ".log.gz").keepFileType().removeContaining("-anon.log").sortByName();
for (File file : files)
{