You do not need threads. Each webware servlet instance runs in its own thread so you do not have to worry about it. That is why you can safely use self.xxxx to manager information about that page request. In Java you would have to be careful to bind any page variables to the Request object.I've never run threads before, so I'm not sure of what its implications can be. I think I should dive into this subject further, once I get my gears running in WebWare mode :) If you need threads you just implement them as regular Python threads, just keep in mind that the user and session may no longer exists at the end of the run, and the AppServer may want to shutdown in the middle of your run as well. For non-debug logging I simply setup some instance properties that I am interested in and the at sleep I write them to a SQL table; class SitePage(Page): ...... def setUpLog(self,actionCode,actionDesc): self._actionCode = actionCode self._actionDesc = actionDesc def sleep(self,trans): if (self._user): username = self._user.name else: username = 'Anonymous' myLog.writeLog(username,self._actionCode,self._actionDesc) Page.sleep(self,trans) and then in my main classes I have something like: class news(SecurePage): .... def prepareContent(self) category = self.request().value('category','None') .... self.setupLog('news','viewing news page, filtered by Category::%s' % category) This type of log will not log an entry if there was an error though, for that you should use the standard logging module in the usual way. Just put convience functions in SitePage so you do not have to think about it. -Aaron |
- Re: [Webware-discuss] First impressions with WebWare Wari Wahab
- RE: [Webware-discuss] Running with mod_python rtjohan
- Re: [Webware-discuss] Running with mod_python Lothar Scholz
- [Webware-discuss] Re: Running with mod_python Aaron Held
- [Webware-discuss] Re: Running with mod_python Wari Wahab
- Re: [Webware-discuss] Re: Running with mod_python Aaron Held
- Re: [Webware-discuss] Re: Running with mod_pyth... Wari Wahab
- Aaron Held
