Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/server/BaseServlet.java @ 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 | d0eb2202ffbe |
children | 2ba44c1b2bab |
comparison
equal
deleted
inserted
replaced
1367:ab8eb2f544f2 | 1368:ec0c81f2c7a4 |
---|---|
16 public void init() | 16 public void init() |
17 throws ServletException | 17 throws ServletException |
18 { | 18 { |
19 System.out.println("BaseServlet.init"); | 19 System.out.println("BaseServlet.init"); |
20 | 20 |
21 initLogging(); | |
22 initConfigParameters(); | |
23 } | |
24 | |
25 | |
26 protected void initLogging() { | |
21 String log4jProperties = getInitParameter("log4j-properties"); | 27 String log4jProperties = getInitParameter("log4j-properties"); |
22 | 28 |
23 if (log4jProperties != null && log4jProperties.length() > 0) { | 29 if (log4jProperties != null && log4jProperties.length() > 0) { |
24 String file = getServletContext().getRealPath(log4jProperties); | 30 String file = getServletContext().getRealPath(log4jProperties); |
25 | 31 |
31 System.out.println("Error while setting up Log4J configuration."); | 37 System.out.println("Error while setting up Log4J configuration."); |
32 } | 38 } |
33 | 39 |
34 System.out.println("BaseServlet.init finished"); | 40 System.out.println("BaseServlet.init finished"); |
35 } | 41 } |
42 | |
43 | |
44 protected void initConfigParameters() { | |
45 String url = getInitParameter("server-url"); | |
46 logger.debug("Found server url: " + url); | |
47 | |
48 getServletContext().setAttribute("server-url", url); | |
49 } | |
36 } | 50 } |