diff MoinMoin/server/server_wsgi.py @ 3015:8d691fbdc929

WSGI: initialize logging (untested) (port from 1.6)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 06 Jan 2008 20:06:00 +0100
parents b902f2397c68
children ed1a433803c6 806cf4814612
line wrap: on
line diff
--- a/MoinMoin/server/server_wsgi.py	Sun Jan 06 20:00:40 2008 +0100
+++ b/MoinMoin/server/server_wsgi.py	Sun Jan 06 20:06:00 2008 +0100
@@ -1,12 +1,31 @@
 """
     MoinMoin - WSGI application
 
-    @copyright: 2005 Anakim Border <akborder@gmail.com>
+    Minimal code for using this:
+
+    import logging
+    from MoinMoin.server.server_wsgi import WsgiConfig, moinmoinApp
+    
+    class Config(WsgiConfig):
+        logPath = 'moin.log' # define your log file here
+        #loglevel_file = logging.INFO # if you do not like the default
+
+    config = Config() # you MUST create an instance to initialize logging!
+    # use moinmoinApp here with your WSGI server / gateway
+
+    @copyright: 2005 Anakim Border <akborder@gmail.com>,
+                2007 MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
 
+from MoinMoin.server import Config
 from MoinMoin.request import request_wsgi
 
+class WsgiConfig(Config):
+    """ WSGI default config """
+    loglevel_stderr = None # we do not want to write to stderr!
+         
+
 def moinmoinApp(environ, start_response):
     request = request_wsgi.Request(environ)
     request.run()