Index: trunk/src/main/java/omq/common/broker/Broker.java
===================================================================
--- trunk/src/main/java/omq/common/broker/Broker.java	(revision 47)
+++ trunk/src/main/java/omq/common/broker/Broker.java	(revision 49)
@@ -2,4 +2,5 @@
 
 import java.io.IOException;
+import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
@@ -20,4 +21,7 @@
 import omq.server.RemoteObject;
 
+import org.apache.log4j.Logger;
+import org.apache.log4j.xml.DOMConfigurator;
+
 import com.rabbitmq.client.Channel;
 import com.rabbitmq.client.Connection;
@@ -28,4 +32,7 @@
 
 public class Broker {
+
+	private static final Logger logger = Logger.getLogger(Broker.class.getName());
+
 	private static Connection connection;
 	private static Channel channel;
@@ -45,4 +52,9 @@
 	public static synchronized void initBroker(Properties env) throws Exception {
 		if (environment == null) {
+
+			// Load log4j configuration
+			URL log4jResource = Broker.class.getResource("/log4j.xml");
+			DOMConfigurator.configure(log4jResource);
+
 			remoteObjs = new HashMap<String, RemoteObject>();
 			environment = env;
@@ -58,9 +70,11 @@
 			}
 		} else {
-			throw new InitBrokerException("Broker already started");
+			logger.error("Broker is already started");
+			throw new InitBrokerException("Broker is already started");
 		}
 	}
 
 	public static void stopBroker() throws Exception {
+		logger.warn("Stopping broker");
 		// Stop the client
 		if (clientStarted) {
@@ -93,4 +107,5 @@
 
 	public static void closeConnection() throws IOException {
+		logger.warn("Clossing connection");
 		connectionClosed = true;
 		connection.close();
@@ -241,4 +256,5 @@
 			@Override
 			public void shutdownCompleted(ShutdownSignalException cause) {
+				logger.warn("Shutdown message received. Cause: " + cause.getMessage());
 				if (!connectionClosed)
 					if (cause.isHardError()) {
Index: trunk/src/main/java/omq/common/event/EventDispatcher.java
===================================================================
--- trunk/src/main/java/omq/common/event/EventDispatcher.java	(revision 47)
+++ trunk/src/main/java/omq/common/event/EventDispatcher.java	(revision 49)
@@ -9,4 +9,6 @@
 import omq.common.util.ParameterQueue;
 import omq.common.util.Serializer;
+
+import org.apache.log4j.Logger;
 
 import com.rabbitmq.client.Channel;
@@ -26,4 +28,5 @@
 @SuppressWarnings("rawtypes")
 public class EventDispatcher extends Thread {
+	private static final Logger logger = Logger.getLogger(EventDispatcher.class.getName());
 	private static EventDispatcher dispatcher;
 
@@ -67,4 +70,5 @@
 
 	public static void stopEventDispatcher() throws Exception {
+		logger.warn("Stopping EventDispatcher");
 		dispatcher.setListeners(null);
 		dispatcher.killed = true;
@@ -102,5 +106,5 @@
 				event = Serializer.deserializeEvent(delivery.getBody());
 
-				System.out.println("Event received -> Topic: " + event.getTopic() + "CorrId: " + event.getCorrId());
+				logger.info("Event received -> Topic: " + event.getTopic() + "CorrId: " + event.getCorrId());
 				// Log.saveLog("Client-Deserialize", delivery.getBody());
 
@@ -112,9 +116,7 @@
 				dispatch(event.getTopic(), event);
 			} catch (InterruptedException i) {
-				System.out.println("InterruptedException e: " + i);
-				i.printStackTrace();
+				logger.error(i);
 			} catch (ShutdownSignalException e) {
-				System.out.println("ShutdownSignalException e: " + e);
-				e.printStackTrace();
+				logger.error(e);
 				try {
 					if (channel.isOpen()) {
@@ -127,14 +129,12 @@
 						Thread.sleep(milis);
 					} catch (InterruptedException e2) {
-						e2.printStackTrace();
+						logger.error(e2);
 					}
-					e1.printStackTrace();
+					logger.error(e1);
 				}
 			} catch (ConsumerCancelledException e) {
-				System.out.println("ConsumerCancelledException e: " + e);
-				e.printStackTrace();
+				logger.error(e);
 			} catch (Exception e) {
-				System.out.println("Exception e: " + e);
-				e.printStackTrace();
+				logger.error(e);
 			}
 		}
@@ -160,5 +160,5 @@
 			String reference = e.getTopic();
 
-			System.out.println("EventDispatcher declaring fanout -> " + reference + " Binding with: " + queueName);
+			logger.info("Declaring fanout -> " + reference + " Binding with: " + queueName);
 
 			channel.exchangeDeclare(reference, "fanout");
Index: trunk/src/main/java/omq/common/util/OmqConnectionFactory.java
===================================================================
--- trunk/src/main/java/omq/common/util/OmqConnectionFactory.java	(revision 47)
+++ trunk/src/main/java/omq/common/util/OmqConnectionFactory.java	(revision 49)
@@ -5,4 +5,6 @@
 import java.security.NoSuchAlgorithmException;
 import java.util.Properties;
+
+import org.apache.log4j.Logger;
 
 import com.rabbitmq.client.Channel;
@@ -16,4 +18,6 @@
  */
 public class OmqConnectionFactory {
+	private static final Logger logger = Logger.getLogger(OmqConnectionFactory.class.getName());
+
 	private static Connection connection;
 	private static int connectionTimeout = 2 * 1000;
@@ -34,5 +38,5 @@
 				working = true;
 			} catch (Exception e) {
-				e.printStackTrace();
+				logger.error(e);
 				long milis = Long.parseLong(env.getProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000"));
 				Thread.sleep(milis);
@@ -64,9 +68,15 @@
 			factory.useSslProtocol();
 		}
-		return factory.newConnection();
+
+		Connection connection = factory.newConnection();
+		logger.info("New connection created using: username: " + username + ", host: " + host + ", port: " + port + ", connection timeout: "
+				+ connectionTimeout + " SSL enabled: " + ssl);
+		return connection;
 	}
 
 	public static Channel getNewChannel() throws IOException {
-		return connection.createChannel();
+		Channel channel = connection.createChannel();
+		logger.info("New channel created using the default connection");
+		return channel;
 	}
 }
Index: trunk/src/main/java/omq/common/util/Serializer.java
===================================================================
--- trunk/src/main/java/omq/common/util/Serializer.java	(revision 47)
+++ trunk/src/main/java/omq/common/util/Serializer.java	(revision 49)
@@ -3,4 +3,6 @@
 import java.io.IOException;
 import java.util.Properties;
+
+import org.apache.log4j.Logger;
 
 import omq.common.broker.Broker;
@@ -21,4 +23,5 @@
  */
 public class Serializer {
+	private static final Logger logger = Logger.getLogger(Serializer.class.getName());
 	public static String kryo = "kryo";
 	public static String java = "java";
@@ -158,4 +161,5 @@
 
 	public static void removeSerializers() {
+		logger.warn("Removing serializers");
 		serializer = null;
 		kryoSerializer = null;
Index: trunk/src/main/java/omq/common/util/Serializers/GsonImp.java
===================================================================
--- trunk/src/main/java/omq/common/util/Serializers/GsonImp.java	(revision 47)
+++ trunk/src/main/java/omq/common/util/Serializers/GsonImp.java	(revision 49)
@@ -22,5 +22,4 @@
 	public byte[] serialize(Object obj) throws SerializerException {
 		String json = gson.toJson(obj);
-		System.out.println(json);
 		return json.getBytes();
 	}
