[Osaas-commits] r52 - in trunk: . server server/osaas server/osaas/http

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Dec 2 13:06:38 CET 2008


Author: bh
Date: 2008-12-02 13:06:37 +0100 (Tue, 02 Dec 2008)
New Revision: 52

Modified:
   trunk/ChangeLog
   trunk/server/demo-config.xml
   trunk/server/osaas/http/run.py
   trunk/server/osaas/run.py
Log:
* server/osaas/http/run.py (ServerProgram.create_option_parser):
New option --log-level to set the log level of access-log and
error-log.  Defaults to INFO
(ServerProgram.setup_logging): Set log level from options.

* server/osaas/run.py (OSAASServerProgram.create_option_parser):
New config file option LogLevel in the OSAASConfig section.

* server/demo-config.xml: Add LogLevel element and corresponding
documentation


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-11-28 20:37:26 UTC (rev 51)
+++ trunk/ChangeLog	2008-12-02 12:06:37 UTC (rev 52)
@@ -1,3 +1,16 @@
+2008-12-02  Bernhard Herzog  <bh at intevation.de>
+
+	* server/osaas/http/run.py (ServerProgram.create_option_parser):
+	New option --log-level to set the log level of access-log and
+	error-log.  Defaults to INFO
+	(ServerProgram.setup_logging): Set log level from options.
+
+	* server/osaas/run.py (OSAASServerProgram.create_option_parser):
+	New config file option LogLevel in the OSAASConfig section.
+
+	* server/demo-config.xml: Add LogLevel element and corresponding
+	documentation
+
 2008-11-28  Bernhard Herzog  <bh at intevation.de>
 
 	* client/java/owsproxy/owsproxy.diff: Adapt to deegree trunk

Modified: trunk/server/demo-config.xml
===================================================================
--- trunk/server/demo-config.xml	2008-11-28 20:37:26 UTC (rev 51)
+++ trunk/server/demo-config.xml	2008-12-02 12:06:37 UTC (rev 52)
@@ -5,10 +5,16 @@
 
   <!-- The files the server will log to.  The access log holds the usual
        HTTP server access log information.  The error log is used to log
-       errors and debug information. 
+       errors and debug information.  If no file is specified, the
+       logging output is written to stderr.
+
+       Supported log levels in order of increasing Verbosity: 
+           CRITICAL, ERROR, WARNING, INFO, DEBUG
+       Default log level is INFO.
     -->
   <AccessLog>/var/log/osaas-access.log</AccessLog>
   <ErrorLog>/var/log/osaas-error.log</ErrorLog>
+  <LogLevel>INFO</LogLevel>
 
   <!-- The users database file. -->
   <UserDB>/etc/osaas-users</UserDB>

Modified: trunk/server/osaas/http/run.py
===================================================================
--- trunk/server/osaas/http/run.py	2008-11-28 20:37:26 UTC (rev 51)
+++ trunk/server/osaas/http/run.py	2008-12-02 12:06:37 UTC (rev 52)
@@ -87,11 +87,14 @@
 
     def create_option_parser(self, **kw):
         parser = ProgramWithOptions.create_option_parser(self, **kw)
-        parser.set_defaults(port=self.default_port)
+        parser.set_defaults(port=self.default_port, log_level="INFO")
         parser.add_option("--port", type="int")
         parser.add_option("--access-log")
         parser.add_option("--error-log")
         parser.add_option("--pid-file")
+        parser.add_option("--log-level",
+                          choices=("CRITICAL", "ERROR", "WARNING", "INFO",
+                                   "DEBUG"))
         return parser
 
     def setup_signals(self):
@@ -115,7 +118,7 @@
                                 ("error",
                             "%(asctime)s %(levelname)s %(name)s %(message)s")]:
             logger = logging.getLogger("httpserver." + logtype)
-            logger.setLevel(logging.DEBUG)
+            logger.setLevel(getattr(logging, opts.log_level))
 
             filename = getattr(opts, logtype + "_log")
             if filename:

Modified: trunk/server/osaas/run.py
===================================================================
--- trunk/server/osaas/run.py	2008-11-28 20:37:26 UTC (rev 51)
+++ trunk/server/osaas/run.py	2008-12-02 12:06:37 UTC (rev 52)
@@ -30,7 +30,8 @@
 
     def create_option_parser(self, **kw):
         parser = ServerProgram.create_option_parser(self, **kw)
-        for name in ["port", "access-log", "error-log", "pid-file"]:
+        for name in ["port", "access-log", "error-log", "log-level",
+                     "pid-file"]:
             path = "OSAASConfig/" + "".join([part.capitalize()
                                              for part in name.split("-")])
             parser.get_option("--" + name).xml_path = path



More information about the Osaas-commits mailing list