From a4b4789a83d4edec088603a330d6bebb4d404fe3 Mon Sep 17 00:00:00 2001 From: brinn <brinn> Date: Thu, 13 Sep 2007 08:01:24 +0000 Subject: [PATCH] change: move notification logging to where the cause of the failure is known and avoid double logging SVN: 1730 --- .../java/ch/systemsx/cisd/datamover/LocalProcessor.java | 9 +++++++++ .../systemsx/cisd/datamover/utils/LazyPathHandler.java | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/datamover/source/java/ch/systemsx/cisd/datamover/LocalProcessor.java b/datamover/source/java/ch/systemsx/cisd/datamover/LocalProcessor.java index 7824f921a8b..6bf7f3e74e8 100644 --- a/datamover/source/java/ch/systemsx/cisd/datamover/LocalProcessor.java +++ b/datamover/source/java/ch/systemsx/cisd/datamover/LocalProcessor.java @@ -44,6 +44,8 @@ public class LocalProcessor implements IPathHandler { private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, LocalProcessor.class); + private static final Logger notificationLog = LogFactory.getLogger(LogCategory.NOTIFY, LocalProcessor.class); + private final Parameters parameters; private final IPathImmutableCopier copier; @@ -149,6 +151,7 @@ public class LocalProcessor implements IPathHandler if (extraCopyDirOrNull != null) { extraTmpCopy = copier.tryCopy(path, tempDir); + notificationLog.error(String.format("Creating extra copy of '%s' failed.", path)); ok = ok && (extraTmpCopy != null); } @@ -156,6 +159,10 @@ public class LocalProcessor implements IPathHandler if (movedFile != null) { outgoingHandler.handle(movedFile); + } else + { + notificationLog.error(String + .format("Moving '%s' to '%s' for final moving process failed.", path, outputDir)); } ok = ok && (movedFile != null); @@ -163,6 +170,8 @@ public class LocalProcessor implements IPathHandler { assert extraCopyDirOrNull != null; File extraCopy = LocalFileSystem.tryMoveLocal(extraTmpCopy, extraCopyDirOrNull); + notificationLog.error(String.format("Moving temporary extra copy '%s' to destination '%s' failed.", + extraTmpCopy, extraCopyDirOrNull)); ok = ok && (extraCopy != null); } return ok; diff --git a/datamover/source/java/ch/systemsx/cisd/datamover/utils/LazyPathHandler.java b/datamover/source/java/ch/systemsx/cisd/datamover/utils/LazyPathHandler.java index 3d5c8c33dc9..7cdcbfaed9a 100644 --- a/datamover/source/java/ch/systemsx/cisd/datamover/utils/LazyPathHandler.java +++ b/datamover/source/java/ch/systemsx/cisd/datamover/utils/LazyPathHandler.java @@ -105,7 +105,7 @@ public class LazyPathHandler implements ITerminable, IPathHandler operationLog.info("Processing succeded: " + resource.getAbsolutePath()); } else { - notificationLog.error("Processing failed: " + resource.getAbsolutePath()); + operationLog.error("Processing failed: " + resource.getAbsolutePath()); } } -- GitLab