CAMEL-6551 RemoteFileConsumer uust writing the warning message at the first time.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f3b03fb9 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f3b03fb9 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f3b03fb9 Branch: refs/heads/master Commit: f3b03fb9336072675f1d44b74a11577a0f8ca929 Parents: 19c966b Author: Willem Jiang <ningji...@apache.org> Authored: Tue Jul 16 10:35:24 2013 +0800 Committer: Willem Jiang <ningji...@apache.org> Committed: Tue Jul 16 10:35:24 2013 +0800 ---------------------------------------------------------------------- .../camel/component/file/remote/RemoteFileConsumer.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/f3b03fb9/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java ---------------------------------------------------------------------- diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java index e347c7d..39e23ce 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java @@ -28,6 +28,7 @@ import org.apache.camel.component.file.GenericFileOperationFailedException; */ public abstract class RemoteFileConsumer<T> extends GenericFileConsumer<T> { protected boolean loggedIn; + protected boolean loggedInWarning; public RemoteFileConsumer(RemoteFileEndpoint<T> endpoint, Processor processor, RemoteFileOperations<T> operations) { super(endpoint, processor, operations); @@ -66,10 +67,16 @@ public abstract class RemoteFileConsumer<T> extends GenericFileConsumer<T> { if (!loggedIn) { String message = "Cannot connect/login to: " + remoteServer() + ". Will skip this poll."; - log.warn(message); + if (!loggedInWarning) { + log.warn(message); + loggedInWarning = true; + } return false; + } else { + // need to log the failed log again + loggedInWarning = false; } - + return true; }