changeset 1368:ec0c81f2c7a4

Replaced stdout and stderr logging with log4j loggers in server classes. flys-client/trunk@3071 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 25 Oct 2011 12:41:16 +0000
parents ab8eb2f544f2
children 1fae113b93fd
files flys-client/src/main/java/de/intevation/flys/client/server/BaseServlet.java flys-client/src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/server/BaseServlet.java	Tue Oct 25 12:31:15 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/BaseServlet.java	Tue Oct 25 12:41:16 2011 +0000
@@ -18,6 +18,12 @@
     {
         System.out.println("BaseServlet.init");
 
+        initLogging();
+        initConfigParameters();
+    }
+
+
+    protected void initLogging() {
         String log4jProperties = getInitParameter("log4j-properties");
 
         if (log4jProperties != null && log4jProperties.length() > 0) {
@@ -33,4 +39,12 @@
 
         System.out.println("BaseServlet.init finished");
     }
+
+
+    protected void initConfigParameters() {
+        String url = getInitParameter("server-url");
+        logger.debug("Found server url: " + url);
+
+        getServletContext().setAttribute("server-url", url);
+    }
 }
--- a/flys-client/src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java	Tue Oct 25 12:31:15 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java	Tue Oct 25 12:41:16 2011 +0000
@@ -34,6 +34,8 @@
     public void doOut(Collection collection, String serverUrl)
     throws ServerException
     {
+        String url = (String) getServletContext().getAttribute("server-url");
+
         logger.info("MapOutputServiceImpl.doOut");
 
         String uuid = collection.identifier();

http://dive4elements.wald.intevation.org