[Twisted-Python] disable twisted.web logging
pbastov at gmail.com
Sun Mar 30 07:12:37 EDT 2008
Phil, your reply is very helpful. Thanks a lot.
I will take your advice into account and next time will post to twisted-web.
On Sun, Mar 30, 2008 at 7:03 AM, Phil Christensen <phil at bubblehouse.org> wrote:
> On Mar 29, 2008, at 1:39 AM, Pavel wrote:
> > Hi all,
> > is there any way to disable twisted.web logging? Or at least
> > control it somehow, e.g. filter and log only necessary entries.
> > Also, is there any way to make http requests be logged into
> > separate file?
> FYI, posts like this should probably go to the twisted-web mailing list.
> I'm not sure what level of control you'd like over the access log,
> but for simple redirection, it's straightforward. Here's how I build
> the Site object:
> myresource = MyResource()
> if(config['logfile'] != '-'):
> site = server.Site(myresource, logPath=config['logfile'])
> site = server.Site(myresource)
> This will let you pass either a log filename or /dev/null as a
> If you'd like more control (like logging different kinds of requests
> to different files), you'll need to get into the LogObserver stuff in
> twisted.python.log... I've only used t.p.log to create custom
> loggers, though, I'm not sure what's involved in filtering t.web's
> log messages....
> Hope this helps,
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
xooChat Team Leader
More information about the Twisted-Python