Index: trunk/sources/HeuristicLab.Hive.Client.Communication/3.2/CommunicationsPlugin.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Client.Communication/3.2/CommunicationsPlugin.cs	(revision 3203)
+++ trunk/sources/HeuristicLab.Hive.Client.Communication/3.2/CommunicationsPlugin.cs	(revision 3578)
@@ -35,4 +35,5 @@
   [PluginDependency("HeuristicLab.Hive.Client.Common-3.2")]
   [PluginDependency("HeuristicLab.Hive.Contracts-3.2")]
+  [PluginDependency("HeuristicLab.Tracing")]
   public class CommunicationsPlugin : PluginBase {
   }
Index: trunk/sources/HeuristicLab.Hive.Client.Communication/3.2/HeuristicLab.Hive.Client.Communication-3.2.csproj
===================================================================
--- trunk/sources/HeuristicLab.Hive.Client.Communication/3.2/HeuristicLab.Hive.Client.Communication-3.2.csproj	(revision 3203)
+++ trunk/sources/HeuristicLab.Hive.Client.Communication/3.2/HeuristicLab.Hive.Client.Communication-3.2.csproj	(revision 3578)
@@ -120,4 +120,8 @@
       <Name>HeuristicLab.PluginInfrastructure</Name>
     </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Tracing\3.2\HeuristicLab.Tracing-3.2.csproj">
+      <Project>{EE2034D9-6E27-48A1-B855-42D45F69A4FC}</Project>
+      <Name>HeuristicLab.Tracing-3.2</Name>
+    </ProjectReference>
   </ItemGroup>
   <ItemGroup>
Index: trunk/sources/HeuristicLab.Hive.Client.Communication/3.2/WcfService.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Client.Communication/3.2/WcfService.cs	(revision 3203)
+++ trunk/sources/HeuristicLab.Hive.Client.Communication/3.2/WcfService.cs	(revision 3578)
@@ -33,4 +33,5 @@
 using System.IO;
 using System.Runtime.Serialization.Formatters.Binary;
+using HeuristicLab.Tracing;
 
 namespace HeuristicLab.Hive.Client.Communication {
@@ -45,6 +46,7 @@
     /// <returns>the Instance of the WcfService class</returns>
     public static WcfService Instance {
-      get {
+      get {        
         if (instance == null) {
+          Logger.Debug("New WcfService Instance created");
           instance = new WcfService();
         }
@@ -76,13 +78,18 @@
     public void Connect() {
       try {
+        Logger.Debug("Starting the Connection Process");
         if (String.Empty.Equals(ServerIP) || ServerPort == 0) {
-          Logging.Instance.Info(this.ToString(), "No Server IP or Port set!");
+          Logger.Info("No Server IP or Port set!");
           return;
         }
+
+        Logger.Debug("Creating the new connection proxy");
         proxy = new ClientFacadeClient(
           WcfSettings.GetStreamedBinding(),
           new EndpointAddress("net.tcp://" + ServerIP + ":" + ServerPort + "/HiveServer/ClientCommunicator")
         );
-
+        Logger.Debug("Created the new connection proxy");
+
+        Logger.Debug("Registring new Events");
         proxy.LoginCompleted += new EventHandler<LoginCompletedEventArgs>(proxy_LoginCompleted);
         proxy.SendStreamedJobCompleted += new EventHandler<SendStreamedJobCompletedEventArgs>(proxy_SendStreamedJobCompleted);
@@ -90,12 +97,17 @@
         proxy.ProcessSnapshotStreamedCompleted += new EventHandler<ProcessSnapshotStreamedCompletedEventArgs>(proxy_ProcessSnapshotStreamedCompleted);
         proxy.ProcessHeartBeatCompleted += new EventHandler<ProcessHeartBeatCompletedEventArgs>(proxy_ProcessHeartBeatCompleted);
+        Logger.Debug("Registered new Events");
+        Logger.Debug("Opening the Connection");
         proxy.Open();
+        Logger.Debug("Opened the Connection");
 
         ConnState = NetworkEnum.WcfConnState.Connected;
         ConnectedSince = DateTime.Now;
-        
-        if (Connected != null)
-          Connected(this, new EventArgs());                               
-        //Todo: This won't be hit. EVER        
+
+        if (Connected != null) {
+          Logger.Debug("Calling the connected Event");
+          Connected(this, new EventArgs());
+          //Todo: This won't be hit. EVER        
+        }
         if (ConnState == NetworkEnum.WcfConnState.Failed)
           ConnectionRestored(this, new EventArgs());        
@@ -113,4 +125,5 @@
     /// <param name="serverPort">current Server Port</param>
     public void Connect(String serverIP, int serverPort) {
+      Logger.Debug("Called Connected with " + serverIP + ":" + serverPort);
       String oldIp = this.ServerIP;
       int oldPort = this.ServerPort;
@@ -124,4 +137,5 @@
 
     public void SetIPAndPort(String serverIP, int serverPort) {
+      Logger.Debug("Called with " + serverIP + ":" + serverPort);
       this.ServerIP = serverIP;
       this.ServerPort = serverPort;
@@ -141,5 +155,5 @@
     private void HandleNetworkError(Exception e) {
       ConnState = NetworkEnum.WcfConnState.Failed;
-      Logging.Instance.Error(this.ToString(), "exception: ", e);
+      Logger.Error("Network exception occurred: " + e);
     }
 
@@ -152,11 +166,14 @@
     public event System.EventHandler<LoginCompletedEventArgs> LoginCompleted;
     public void LoginAsync(ClientDto clientInfo) {
-      if (ConnState == NetworkEnum.WcfConnState.Connected)
+      if (ConnState == NetworkEnum.WcfConnState.Connected) {
+        Logger.Debug("STARTED: Login Async");
         proxy.LoginAsync(clientInfo);
+      }
     }
     private void proxy_LoginCompleted(object sender, LoginCompletedEventArgs e) {
-      if (e.Error == null)
+      if (e.Error == null) {
+        Logger.Debug("ENDED: Login Async");
         LoginCompleted(sender, e);
-      else
+      } else
         HandleNetworkError(e.Error.InnerException);
     }
@@ -165,11 +182,12 @@
       try {
         if (ConnState == NetworkEnum.WcfConnState.Connected) {
+          Logger.Debug("STARTED: Login Sync");
           Response res = proxy.Login(clientInfo);
           if (!res.Success) {
-            Logging.Instance.Error(this.ToString(), "Login Failed! " + res.StatusMessage);
-            HandleNetworkError(new Exception(res.StatusMessage));
+            Logger.Error("FAILED: Login Failed! " + res.StatusMessage);
+            throw new Exception(res.StatusMessage);
           } else {
-            ConnState = NetworkEnum.WcfConnState.Loggedin;
-            Logging.Instance.Info(this.ToString(), res.StatusMessage);
+            Logger.Info("ENDED: Login succeeded" + res.StatusMessage);
+            ConnState = NetworkEnum.WcfConnState.Loggedin;            
           }
         }
@@ -188,10 +206,13 @@
     public event System.EventHandler<SendJobCompletedEventArgs> SendJobCompleted;
     public void SendJobAsync(Guid guid) {
-      if (ConnState == NetworkEnum.WcfConnState.Loggedin)        
+      if (ConnState == NetworkEnum.WcfConnState.Loggedin) {
+        Logger.Debug("STARTED: Fetching of Jobs from Server for Client");
         proxy.SendStreamedJobAsync(guid);
+      }
     }
 
     void proxy_SendStreamedJobCompleted(object sender, SendStreamedJobCompletedEventArgs e) {
       if (e.Error == null) {
+        Logger.Debug("ENDED: Fetching of Jobs from Server for Client");
         Stream stream = null;
         MemoryStream memStream = null;
@@ -220,6 +241,7 @@
             new SendJobCompletedEventArgs(new object[] { response, memStream.GetBuffer() }, e.Error, e.Cancelled, e.UserState);
           SendJobCompleted(sender, completedEventArgs);
-        }
-        finally {
+        } catch (Exception ex) {
+          Logger.Error(ex);
+        } finally {
           if(stream != null)
             stream.Dispose();
@@ -241,21 +263,28 @@
     public void StoreFinishedJobResultAsync(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception, bool finished) {
       if (ConnState == NetworkEnum.WcfConnState.Loggedin) {
+        Logger.Debug("STARTED: Sending back the finished job results");
+        Logger.Debug("Building stream");
         Stream stream =
           GetStreamedJobResult(clientId, jobId, result, percentage, exception);
-
+        Logger.Debug("Builded stream");
+        Logger.Debug("Making the call");
         proxy.StoreFinishedJobResultStreamedAsync(stream, stream);
       }
      }
     private void proxy_StoreFinishedJobResultStreamedCompleted(object sender, StoreFinishedJobResultStreamedCompletedEventArgs e) {
+      Logger.Debug("Finished storing the job");
       Stream stream =
         (Stream)e.UserState;
-      if (stream != null)
+      if (stream != null) {
+        Logger.Debug("Stream not null, disposing it");
         stream.Dispose();
-      
+      }
       if (e.Error == null) {
         StoreFinishedJobResultCompletedEventArgs args =
           new StoreFinishedJobResultCompletedEventArgs(
             new object[] { e.Result }, e.Error, e.Cancelled, e.UserState);
+        Logger.Debug("calling the Finished Job Event");
         StoreFinishedJobResultCompleted(sender, args);
+        Logger.Debug("ENDED: Sending back the finished job results");
       } else
         HandleNetworkError(e.Error);
@@ -300,15 +329,18 @@
     public void SendHeartBeatAsync(HeartBeatData hbd) {
       if (ConnState == NetworkEnum.WcfConnState.Loggedin)
+        Logger.Debug("STARTING: sending heartbeat");
         proxy.ProcessHeartBeatAsync(hbd);
     }
 
     private void proxy_ProcessHeartBeatCompleted(object sender, ProcessHeartBeatCompletedEventArgs e) {
-      if (e.Error == null && e.Result.Success == true)
+      if (e.Error == null && e.Result.Success == true) {
         SendHeartBeatCompleted(sender, e);
-      else {
+        Logger.Debug("ENDED: sending heartbeats");
+      } else {
         try {
-          Logging.Instance.Error(this.ToString(), "Error: " + e.Result.StatusMessage);
-        } catch (Exception ex) {
-          Logging.Instance.Error(this.ToString(), "Error: ", ex);          
+          Logger.Error("Error: " + e.Result.StatusMessage);
+        }
+        catch (Exception ex) {
+          Logger.Error("Error: ", ex);
         }
         HandleNetworkError(e.Error);
@@ -351,5 +383,8 @@
     public Response IsJobStillNeeded(Guid jobId) {
       try {
-        return proxy.IsJobStillNeeded(jobId);
+        Logger.Debug("STARTING: Sync call: IsJobStillNeeded");
+        Response res = proxy.IsJobStillNeeded(jobId);
+        Logger.Debug("ENDED: Sync call: IsJobStillNeeded");
+        return res;
       }
       catch (Exception e) {
@@ -361,6 +396,5 @@
 
     public ResponseResultReceived ProcessSnapshotSync(Guid clientId, Guid jobId, byte[] result, double percentage, Exception exception) {
-      try {
-        Logging.Instance.Info(this.ToString(), "Snapshot for Job " + jobId + " submitted");
+      try {        
         return proxy.ProcessSnapshotStreamed(
           GetStreamedJobResult(clientId, jobId, result, percentage, exception));
@@ -374,9 +408,15 @@
     public List<CachedHivePluginInfoDto> RequestPlugins(List<HivePluginInfoDto> requestedPlugins) {
       try {
+        Logger.Debug("STARTED: Requesting Plugins for Job");
+        Logger.Debug("STARTED: Getting the stream");
         Stream stream = proxy.SendStreamedPlugins(requestedPlugins.ToArray());
-
+        Logger.Debug("ENDED: Getting the stream");
         BinaryFormatter formatter =
           new BinaryFormatter();
+        Logger.Debug("STARTED: Deserializing the stream");
         ResponsePlugin response = (ResponsePlugin)formatter.Deserialize(stream);
+        Logger.Debug("ENDED: Deserializing the stream");
+        if (stream != null)
+          stream.Dispose();        
         return response.Plugins;        
       }
@@ -389,5 +429,7 @@
     public void Logout(Guid guid) {
       try {
+        Logger.Debug("STARTED: Logout");
         proxy.Logout(guid);
+        Logger.Debug("ENDED: Logout");
       }
       catch (Exception e) {
@@ -398,5 +440,8 @@
     public ResponseCalendar GetCalendarSync(Guid clientId) {
       try {
-        return proxy.GetCalendar(clientId);        
+        Logger.Debug("STARTED: Syncing Calendars");
+        ResponseCalendar cal = proxy.GetCalendar(clientId);
+        Logger.Debug("ENDED: Syncing Calendars");
+        return cal;
       }
       catch (Exception e) {
@@ -408,5 +453,8 @@
     public Response SetCalendarStatus (Guid clientId, CalendarState state) {
       try {
-        return proxy.SetCalendarStatus(clientId, state);        
+        Logger.Debug("STARTED: Setting Calendar status to: " + state);
+        Response resp = proxy.SetCalendarStatus(clientId, state);
+        Logger.Debug("ENDED: Setting Calendar status to: " + state);
+        return resp;
       } catch (Exception e) {
         HandleNetworkError(e);
