Ignore:
Timestamp:
06/19/13 15:59:53 (11 years ago)
Author:
stoda
Message:

log4j added

Location:
trunk/src/main/java/omq/common/util
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/main/java/omq/common/util/OmqConnectionFactory.java

    r44 r49  
    55import java.security.NoSuchAlgorithmException;
    66import java.util.Properties;
     7
     8import org.apache.log4j.Logger;
    79
    810import com.rabbitmq.client.Channel;
     
    1618 */
    1719public class OmqConnectionFactory {
     20        private static final Logger logger = Logger.getLogger(OmqConnectionFactory.class.getName());
     21
    1822        private static Connection connection;
    1923        private static int connectionTimeout = 2 * 1000;
     
    3438                                working = true;
    3539                        } catch (Exception e) {
    36                                 e.printStackTrace();
     40                                logger.error(e);
    3741                                long milis = Long.parseLong(env.getProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000"));
    3842                                Thread.sleep(milis);
     
    6468                        factory.useSslProtocol();
    6569                }
    66                 return factory.newConnection();
     70
     71                Connection connection = factory.newConnection();
     72                logger.info("New connection created using: username: " + username + ", host: " + host + ", port: " + port + ", connection timeout: "
     73                                + connectionTimeout + " SSL enabled: " + ssl);
     74                return connection;
    6775        }
    6876
    6977        public static Channel getNewChannel() throws IOException {
    70                 return connection.createChannel();
     78                Channel channel = connection.createChannel();
     79                logger.info("New channel created using the default connection");
     80                return channel;
    7181        }
    7282}
  • trunk/src/main/java/omq/common/util/Serializer.java

    r47 r49  
    33import java.io.IOException;
    44import java.util.Properties;
     5
     6import org.apache.log4j.Logger;
    57
    68import omq.common.broker.Broker;
     
    2123 */
    2224public class Serializer {
     25        private static final Logger logger = Logger.getLogger(Serializer.class.getName());
    2326        public static String kryo = "kryo";
    2427        public static String java = "java";
     
    158161
    159162        public static void removeSerializers() {
     163                logger.warn("Removing serializers");
    160164                serializer = null;
    161165                kryoSerializer = null;
  • trunk/src/main/java/omq/common/util/Serializers/GsonImp.java

    r44 r49  
    2222        public byte[] serialize(Object obj) throws SerializerException {
    2323                String json = gson.toJson(obj);
    24                 System.out.println(json);
    2524                return json.getBytes();
    2625        }
Note: See TracChangeset for help on using the changeset viewer.