diff flys-client/src/main/java/de/intevation/flys/client/server/CollectionAttributeServiceImpl.java @ 1367:ab8eb2f544f2

Replaced stdout and stderr logging with log4j loggers in server classes. flys-client/trunk@3069 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 25 Oct 2011 12:31:15 +0000
parents 26e38b79658d
children bc06a671ef60
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/server/CollectionAttributeServiceImpl.java	Tue Oct 25 11:07:14 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/CollectionAttributeServiceImpl.java	Tue Oct 25 12:31:15 2011 +0000
@@ -2,6 +2,8 @@
 
 import org.w3c.dom.Document;
 
+import org.apache.log4j.Logger;
+
 import de.intevation.artifacts.common.utils.ClientProtocolUtils;
 
 import de.intevation.artifacts.httpclient.exceptions.ConnectionException;
@@ -22,6 +24,10 @@
 extends      DescribeCollectionServiceImpl
 implements   CollectionAttributeService
 {
+    private static final Logger logger =
+        Logger.getLogger(CollectionAttributeServiceImpl.class);
+
+
     public static final String ERROR_UPDATING_COLLECTION_ATTRIBUTE =
         "error_update_collection_attribute";
 
@@ -29,7 +35,7 @@
     public Collection update(Collection collection, String url, String locale)
     throws ServerException
     {
-        System.out.println("CollectionAttributeServiceImpl.update");
+        logger.info("CollectionAttributeServiceImpl.update");
 
         Document attribute = CollectionHelper.createAttribute(collection);
         Document action    = ClientProtocolUtils.newSetAttributeDocument(
@@ -43,12 +49,12 @@
                 collection.identifier(),
                 new DocumentResponseHandler());
 
-            System.out.println("Collection attribute successfully set.");
+            logger.debug("Collection attribute successfully set.");
 
             return describe(collection.identifier(), url, locale);
         }
         catch (ConnectionException ce) {
-            System.err.println(ce.getLocalizedMessage());
+            logger.error(ce, ce);
         }
 
         throw new ServerException(ERROR_UPDATING_COLLECTION_ATTRIBUTE);

http://dive4elements.wald.intevation.org