comparison 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
comparison
equal deleted inserted replaced
3014:dc970f2d146c 3015:8d691fbdc929
1 """ 1 """
2 MoinMoin - WSGI application 2 MoinMoin - WSGI application
3 3
4 @copyright: 2005 Anakim Border <akborder@gmail.com> 4 Minimal code for using this:
5
6 import logging
7 from MoinMoin.server.server_wsgi import WsgiConfig, moinmoinApp
8
9 class Config(WsgiConfig):
10 logPath = 'moin.log' # define your log file here
11 #loglevel_file = logging.INFO # if you do not like the default
12
13 config = Config() # you MUST create an instance to initialize logging!
14 # use moinmoinApp here with your WSGI server / gateway
15
16 @copyright: 2005 Anakim Border <akborder@gmail.com>,
17 2007 MoinMoin:ThomasWaldmann
5 @license: GNU GPL, see COPYING for details. 18 @license: GNU GPL, see COPYING for details.
6 """ 19 """
7 20
21 from MoinMoin.server import Config
8 from MoinMoin.request import request_wsgi 22 from MoinMoin.request import request_wsgi
23
24 class WsgiConfig(Config):
25 """ WSGI default config """
26 loglevel_stderr = None # we do not want to write to stderr!
27
9 28
10 def moinmoinApp(environ, start_response): 29 def moinmoinApp(environ, start_response):
11 request = request_wsgi.Request(environ) 30 request = request_wsgi.Request(environ)
12 request.run() 31 request.run()
13 start_response(request.status, request.headers) 32 start_response(request.status, request.headers)