[Twisted-web] web2 vs. access.log

Tommi Virtanen tv at twistedmatrix.com
Sun Apr 10 09:05:19 MDT 2005

Hi. I'm trying to hack vhost-specific access.log
(.../vhost/canonicalhostnamehere.log) support into
nevow, and while doing that, ran into web2's logging
features -- I don't want to do things totally differently
from web2.

What I did with nevow was add ILogger, which is looked
up from the context and is responsible for writing the
access.log entry for the current request. Thus, vhosts
can just remember an ILogger to implement different access
log destinations.

What web2 seems to be heading at is using log.msg and a
interface=IRequest to do access.logging. How do you see
my vhost logging functionality should be done with web2?
Adding observers doesn't really help, AFAICS the best you
could do that way is log the request in both the default
access.log and the vhost log file.

Also, web2 really should pass the context to log.msg().

Also, how do you feel the date and time generation and parsing
in t.w.http should be done? I need to be able to generate
access.log entries, and current t.w.http really isn't librarified
enough. I'm thinking of extracting that functionality in a more
library-like manner into nevow.timestamp and nevow.log, which could at
the same time become t.web2.{timestamp,log}.

More information about the Twisted-web mailing list