Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

old cookbook didn't work for wsgilog 0.2

  • Loading branch information...
commit 0c08136740c57d13ae793424c5bef6f52802eddb 1 parent 0550203
danigm danigm authored anandology committed
Showing with 4 additions and 4 deletions.
  1. +4 −4 cookbook/logging.md
8 cookbook/logging.md
View
@@ -15,10 +15,10 @@ You want to control logging for default HTTPServer.
With the built-in webserver you can control logging by using [wsgilog](http://pypi.python.org/pypi/wsgilog/) and passing it to your app as [middleware](http://en.wikipedia.org/wiki/Middleware).
-You need to subclass wsgilog.WsgiLog to pass keyword arguments to the base e.g. [this example](http://github.com/harryf/urldammit/blob/234bcaae6deb65240e64ee3199213712ed62883a/dammit/log.py)
+This code works for wsgilog version 0.2
import sys, logging
- from wsgilog import WsgiLog, LogIO
+ from wsgilog import WsgiLog
import config
class Log(WsgiLog):
@@ -28,12 +28,12 @@ You need to subclass wsgilog.WsgiLog to pass keyword arguments to the base e.g.
application,
logformat = '%(message)s',
tofile = True,
+ toprint = True,
file = config.log_file,
interval = config.log_interval,
backups = config.log_backups
)
- sys.stdout = LogIO(self.logger, logging.INFO)
- sys.stderr = LogIO(self.logger, logging.ERROR)
+
Then when you run your app, you pass a reference to to the class e.g. (if the above was part of the module 'mylog')
Please sign in to comment.
Something went wrong with that request. Please try again.