Re: [Zope] logging for virtual hosts

2000-11-10 Thread zope

Well, I tried the source hacking approach and seem to have found
success with relatively little pain.

In ZServer/medusa/http_server.py, the "log" method of the class
"http_request" can be modified to report the request hostname which
is readily available via the get_header method in the same class. Here
is my modified "log" method:


def log (self, bytes):
user_agent=self.get_header('user-agent')
if not user_agent: user_agent=''
referer=self.get_header('referer')
host=self.get_header('host')
if not referer: referer=''  
self.channel.server.logger.log (
self.channel.addr[0],
' - - [%s] "%s" %d %d "%s" "%s" %s\n' % (
self.log_date_string (time.time()),
self.request,
self.reply_code,
bytes,
referer,
user_agent,
host
)
)

Note that this puts the request hostname at the end of the log
entry.

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] logging for virtual hosts

2000-11-09 Thread zope

We are using SiteAccess to have multiple virtual hosts on one Zope
Server. We would like to provide our customers with stats reports
based on the zope log. But entries in the log don't contain any
distinguishing information about the virtual host to which the entry
applies. Short of hacking zope, is there a way to modify our zope
environment to to have the requested hostname included in the log
entry?

We know that we can use PCGI thru apache and have apache do the
logging. But I'm hoping to avoid that.

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] logging for virtual hosts

2000-11-09 Thread Jason C. Leach

hi,

I have the same prob. Although I have not implemented it yet, I was
thinking of doing a python method that I could pass all the info into and
stick in in the site rules.  That would probably only do the main hit
(perhaps if all pages go through the it will to all of them).

j.

..
. Jason C. Leach
... University College of the Cariboo.
.. 

On 9 Nov 2000 [EMAIL PROTECTED] wrote:

 We are using SiteAccess to have multiple virtual hosts on one Zope
 Server. We would like to provide our customers with stats reports
 based on the zope log. But entries in the log don't contain any
 distinguishing information about the virtual host to which the entry
 applies. Short of hacking zope, is there a way to modify our zope
 environment to to have the requested hostname included in the log
 entry?
 
 We know that we can use PCGI thru apache and have apache do the
 logging. But I'm hoping to avoid that.
 


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )