Index: /DCWoRMS/trunk/src/test/DEBBTranslator/src/test/DEBBTranslator/src/DEBB2DCWoRMSTranslator.java
===================================================================
--- /DCWoRMS/trunk/src/test/DEBBTranslator/src/test/DEBBTranslator/src/DEBB2DCWoRMSTranslator.java	(revision 615)
+++ /DCWoRMS/trunk/src/test/DEBBTranslator/src/test/DEBBTranslator/src/DEBB2DCWoRMSTranslator.java	(revision 616)
@@ -26,4 +26,6 @@
 import javax.xml.xpath.XPathFactory;
 
+import org.apache.log4j.BasicConfigurator;
+import org.apache.log4j.Logger;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Comment;
@@ -45,5 +47,5 @@
 	// TODO:
 	// 1) Configuration file needed
-	// 2) Get rid of all nasty System.out - log4j instead
+	// 2)
 	// 3)
 
@@ -63,5 +65,6 @@
 	private static XPath xpath;
 	private static Document dcwormsDocument;
-
+	private static Logger logger = Logger.getLogger(DEBB2DCWoRMSTranslator.class);
+	
 	/**
 	 * 
@@ -91,5 +94,11 @@
 			}
 		}
-
+		BasicConfigurator.configure();
+		
+		logger.debug("inputFileName=" + inputFileName);
+		logger.debug("outputFileName=" + outputFileName);
+		
+
+		
 		try {
 			initialize();
@@ -108,6 +117,6 @@
 			Object result = expr.evaluate(plmxmlDocument, XPathConstants.NODE);
 			Node rootIdNode = (Node) result;
-			System.out.println(rootIdNode.getNodeName());
-			System.out.println(rootIdNode.getNodeValue());
+			logger.debug(rootIdNode.getNodeName());
+			logger.debug(rootIdNode.getNodeValue());
 
 			// Creating destination, dcworms document
@@ -163,18 +172,13 @@
 
 		} catch (ParserConfigurationException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
+			logger.error("Parser configuration exception", e);
 		} catch (IOException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
+			logger.error("I/O exception", e);
 		} catch (SAXException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
+			logger.error("SAX exception", e);
 		} catch (XPathExpressionException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
+			logger.error("XPATH expression exception", e);
 		} catch (Exception e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
+			logger.error("Non specific exception", e);
 		}
 
@@ -259,5 +263,5 @@
 			transformer.transform(source, transformResult);
 
-			System.out.println("File " + outputFileName + " saved!");
+			logger.debug("File " + outputFileName + " saved!");
 
 		} catch (TransformerConfigurationException e) {
@@ -286,11 +290,14 @@
 
 		if (instanceId == null) {
+			logger.error("DEBB identifier is null");
 			throw new Exception("Null DEBB identifier");
 		}
 		if (plmxmlDocument == null) {
+			logger.error("PLM XML document is null");
 			throw new Exception("Null PLM XML document");
 		}
 
 		if (debbParentElement == null) {
+			logger.error("Parent node in output DCWoRMS document is null");
 			throw new Exception("Null parent element in dcworms document");
 		}
@@ -306,8 +313,8 @@
 		Node debbNameNode = productInstanceNode.getAttributes().getNamedItem(
 				"name");
-		System.out.println("name=" + debbNameNode.getNodeValue());
+		logger.debug("name=" + debbNameNode.getNodeValue());
 		Node partRefNode = productInstanceNode.getAttributes().getNamedItem(
 				"partRef");
-		System.out.println("partRef=" + partRefNode.getNodeValue());
+		logger.debug("partRef=" + partRefNode.getNodeValue());
 		String partId = partRefNode.getNodeValue().substring(1); // Get rid of #
 		// at
@@ -346,5 +353,5 @@
 		Node productRevisionViewNode = (Node) result;
 		// debbName = productRevisionView.getAttributes().getNamedItem("name");
-		// System.out.println("name=" + debbName.getNodeValue());
+		// logger.debug("name=" + debbName.getNodeValue());
 
 		// UserValue (to extract DEBB name, level or DEBBComponent file)
@@ -355,5 +362,5 @@
 		Node debbComponentIdNode = (Node) result;
 		if (debbComponentIdNode != null) {
-			System.out.println("debbComponentId="
+			logger.debug("debbComponentId="
 					+ debbComponentIdNode.getNodeValue());
 		}
@@ -365,5 +372,5 @@
 		Node debbLevelNode = (Node) result;
 		if (debbLevelNode != null) {
-			System.out.println("debbLevel=" + debbLevelNode.getNodeValue());
+			logger.debug("debbLevel=" + debbLevelNode.getNodeValue());
 		}
 
@@ -380,5 +387,5 @@
 			debbComponentFileName = DEFAULT_DEBB_COMPONENT_INPUT_FILE_NAME;
 		}
-		System.out.println("debbComponentFileToOpen=" + debbComponentFileName);
+		logger.debug("debbComponentFileToOpen=" + debbComponentFileName);
 
 		// *****************************************************************
@@ -398,5 +405,5 @@
 
 			Document debbComponentDocument = readDEBBComponentInputFile(debbComponentFileName);
-			System.out.println("debbComponentNode="
+			logger.debug("debbComponentNode="
 					+ debbComponentIdNode.getNodeValue());
 			expr = xpath.compile("//*[ComponentId='"
@@ -405,8 +412,10 @@
 			Node debbComponentNode = (Node) result;
 			if (debbComponentNode != null) {
-				System.out.println("debbComponentNode="
+				logger.debug("debbComponentNode="
 						+ debbComponentNode.getNodeName());
 			}
 
+			// *****************************************************************
+			//	Translation of information about debb taken from DEBB components file
 			// DOMSource/DOMResult
 			try {
@@ -424,9 +433,8 @@
 
 				trans.transform(domSource, domResult);
-				System.out.println("result node="
+				logger.debug("result node="
 						+ domResult.getNode().getNodeName());
 			} catch (NullPointerException npEx) {
-				System.out.println("NullPointerException on debb "
-						+ debbComponentIdNode.getNodeValue());
+				logger.info("Cannot find debb " + debbComponentIdNode.getNodeValue() + " in corresponding DEBB Components file");
 			}
 
@@ -503,14 +511,14 @@
 			if (instanceRefsNode != null) {
 				String instances = instanceRefsNode.getNodeValue();
-				System.out.println("instances=" + instances);
+				logger.debug("instances=" + instances);
 				// Separate instance ids
 				StringTokenizer tokenizer = new StringTokenizer(instances, " ");
 				while (tokenizer.hasMoreTokens()) {
 					String instance = tokenizer.nextToken();
-					System.out.println(instance);
+					logger.debug(instance);
 					// Go down in the hierarchy
 					transformDEBB(plmxmlDocument, dcwormsDocument,
 							computingResourceElement, instance);
-					System.out.println();
+					logger.debug("\n");
 				}
 			}
