Re: [Zope] Script execute with every request
Joshua Burvill wrote: Hi, I’d like to log certain parts of each request into a database table for every request to provide an audit trail. I thought of inserting a into the standard_html_header, but when there is a RESPONSE.redirect, it will not be the original request that gets logged. Can anyone offer any suggestions? Thanks, Josh Dieter wrote this http://www.dieter.handshake.de/pyprojects/zope/emulateRedirect.py Maybe that helps. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Script execute with every request
Ok, so I could put a into my standard_html_header, and any redirects do them with a call to Dieters script (which may not work with future zope versions) to make sure I am keeping the original request. Hmm, is there a better solution anyone knows of? Basically I just want to do an insert into a database of some stuff from each request. Josh From: David H [mailto:[EMAIL PROTECTED] Sent: Wednesday, 19 July 2006 11:27 AM To: Joshua Burvill Cc: zope@zope.org Subject: Re: [Zope] Script execute with every request Joshua Burvill wrote: Hi, I’d like to log certain parts of each request into a database table for every request to provide an audit trail. I thought of inserting a into the standard_html_header, but when there is a RESPONSE.redirect, it will not be the original request that gets logged. Can anyone offer any suggestions? Thanks, Josh Dieter wrote this http://www.dieter.handshake.de/pyprojects/zope/emulateRedirect.py Maybe that helps. -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.1/391 - Release Date: 18/07/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.3/395 - Release Date: 21/07/2006 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Script execute with every request
Joshua Burvill wrote: Hi, I’d like to log certain parts of each request into a database table for every request to provide an audit trail. I thought of inserting a into the standard_html_header, but when there is a RESPONSE.redirect, it will not be the original request that gets logged. Well that would mean 2 log entries - one from the redirecting page and one from the target of the redirect. Btw, its usually not the best idea if you can avoid it - what about using the apache log facilities here? Can anyone offer any suggestions? Thanks, Josh -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.1/391 - Release Date: 18/07/2006 Ah, wasting cpu cycles for nothing :-) Regards Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Script execute with every request
You have not mentioned what your use case is or what data you want to store, but another possible option would be to have every url call the same script; that script then logs/stores the desired information and then passes control (redirect or direct call) to the target routine (information about the target routine can be embedded within the url so that the initially invoked script can appropriately route control). Jonathan - Original Message - From: Joshua Burvill To: 'David H' Cc: zope@zope.org Sent: Monday, July 24, 2006 12:01 AM Subject: RE: [Zope] Script execute with every request Ok, so I could put a into my standard_html_header, and any redirects do them with a call to Dieters script (which may not work with future zope versions) to make sure I am keeping the original request. Hmm, is there a better solution anyone knows of? Basically I just want to do an insert into a database of some stuff from each request. Josh From: David H [mailto:[EMAIL PROTECTED] Sent: Wednesday, 19 July 2006 11:27 AMTo: Joshua BurvillCc: zope@zope.orgSubject: Re: [Zope] Script execute with every request Joshua Burvill wrote: Hi, I’d like to log certain parts of each request into a database table for every request to provide an audit trail. I thought of inserting a into the standard_html_header, but when there is a RESPONSE.redirect, it will not be the original request that gets logged. Can anyone offer any suggestions? Thanks, Josh Dieter wrote this http://www.dieter.handshake.de/pyprojects/zope/emulateRedirect.pyMaybe that helps. --No virus found in this incoming message.Checked by AVG Free Edition.Version: 7.1.394 / Virus Database: 268.10.1/391 - Release Date: 18/07/2006 --No virus found in this outgoing message.Checked by AVG Free Edition.Version: 7.1.394 / Virus Database: 268.10.3/395 - Release Date: 21/07/2006 ___Zope maillist - Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope** No cross posts or HTML encoding! **(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Script execute with every request
Joshua Burvill wrote at 2006-7-24 14:01 +1000: > ... >Basically I just want to do an insert into a database of some stuff from >each request. Sounds like work for a "SiteAccess" "AccessRule"... -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Script execute with every request
Say no more, that’s exactly what I was looking for. I just (zope 2.6.4) selected "Set access Rule" in the zmi and click Add, enter the name of the script I want to execute and that’s it. I knew there had to be a simple way. Thanks a lot Dieter, Josh -Original Message- From: Dieter Maurer [mailto:[EMAIL PROTECTED] Sent: Tuesday, 25 July 2006 4:01 AM To: Joshua Burvill Cc: 'David H'; zope@zope.org Subject: RE: [Zope] Script execute with every request Joshua Burvill wrote at 2006-7-24 14:01 +1000: > ... >Basically I just want to do an insert into a database of some stuff from >each request. Sounds like work for a "SiteAccess" "AccessRule"... -- Dieter -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.4/396 - Release Date: 24/07/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.4/396 - Release Date: 24/07/2006 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )