added logger and log4j.properties, some helper methods in msgFactory