Re: [PyCS-devel] question: better logging (per user)
Status: Alpha
Brought to you by:
myelin
|
From: Georg B. <gb...@mu...> - 2003-03-12 13:00:20
|
Hi! > I already have a hack working (not yet checked in, though) that will > patch the http_request objects in a way that they log in the combined > log format (with referrers and user-agent info). I currently investigate > how > complicated it would be to get Apache pass on the client address in a > header, so I could use that in the logging to replace the apache machine > header. Ok, it is now working. I have added a new vhostfrom rule to the rewrite.conf.default and added several patches in pycs.py and pycs_rewrite_handler.py. The main problem is, that medusa doesn't give a nice way to specify what class to use for http requests. So to do all this nicely, I would have to overload the full hierarchy and make changes to several methods and classes. To prevent that (as that would likely break with newer releases where the inner workings change), I just patch some class objects with setattr. This will break with newer versions, too, if some key components change. But that's only very small code added, and only actually one dependency on inner workings at all: I assume that http_request objects have a header and _header_cache instance variable like they do now. So if someone want's to dig into the code, be warned. It is butt ugly ;-) But it works. I now have a nice and shiny combined log with remote host IPs, referrers and user agent informations, but it is created on the community server. And it uses all rewriting rules, so I get only normalized URLs (/users/xxxxxx/ stuff). This can be splitted by user and so I could set up webalizer to just sum up stuff for one user. Or do other nice things with that :-) bye, Georg |