diff --git a/src/main/java/com/teragrep/rlo_12/DirectoryEventWatcher.java b/src/main/java/com/teragrep/rlo_12/DirectoryEventWatcher.java index 2430266..899c259 100644 --- a/src/main/java/com/teragrep/rlo_12/DirectoryEventWatcher.java +++ b/src/main/java/com/teragrep/rlo_12/DirectoryEventWatcher.java @@ -294,7 +294,10 @@ public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IO @Override public FileVisitResult visitFileFailed(Path path, IOException exc) { - LOGGER.warn("visitFileFailed <[{}]> is not accessible, skipping due to:", path, exc); + if (LOGGER.isWarnEnabled()) { + LOGGER.warn("visitFileFailed <[{}]> is not accessible, skipping due to <{}>", path, exc.getMessage()); + } + return FileVisitResult.CONTINUE; } @@ -302,7 +305,9 @@ public FileVisitResult visitFileFailed(Path path, IOException exc) { public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { LOGGER.trace("postVisitDirectory <[{}]>", dir); if (exc != null) { - LOGGER.warn("Directory <[{}]> caused:", dir, exc); + if (LOGGER.isWarnEnabled()) { + LOGGER.warn("Directory <[{}]> caused <{}>", dir, exc.getMessage()); + } return FileVisitResult.SKIP_SUBTREE; } else { return FileVisitResult.CONTINUE;