Re: [Zope-dev] Logging for ZScheduler?
I've created a STUPID_LOG helper product, called FrozenLogger, that does the minimum necessary for me to create a STUPID_LOG_FILE at my account at CodeIt Computing (where lack of telnet keeps me from setting environment variables). http://www.zope.org/Members/lstaffor/FrozenLogger The core of this is: from Globals import data_dir if os.environ.has_key('STUPID_LOG_FILE'): pass else: os.environ['STUPID_LOG_FILE']=string.join((data_dir,'FrozenLogger.txt'),'/') It works for me at CodeIt, but I doubt if it's general enough for some of the Zope virtual hosting schemes I've read about here. Let me know how your mileage varies. -- Loren - Original Message - From: "Stuart 'Zen' Bishop" [EMAIL PROTECTED] To: "Loren Stafford" [EMAIL PROTECTED] Cc: "Loren Stafford" [EMAIL PROTECTED]; "zope-dev" [EMAIL PROTECTED] Sent: June 15, 2000 01:57 PM Subject: RE: [Zope-dev] Logging for ZScheduler? On Thu, 15 Jun 2000, Loren Stafford wrote: Aha! Even tho a cohosted account might not be able to modify the source of the Zope implementation directly, installing a CustomLog product could do so indirectly, by importing ZLogger and modifying the loggers tuple. To know where to write the log file, CustomLog would have to either know or be configurable enough to adapt to the ISP's Zope configuration. I suppose an absolute path property would be suffient. An ISP could preconfigure and preinstall the CustomLog product for all users, or each user could do it. Dump it Globals.data_dir unless a given environment variable is set. (Sorry bout the double reply) -- Stuart Bishop Work: [EMAIL PROTECTED] Senior Systems Alchemist Play: [EMAIL PROTECTED] Computer Science, RMIT University ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Logging for ZScheduler?
"Phillip J. Eby" wrote: At 01:58 PM 6/15/00 +1000, Stuart 'Zen' Bishop wrote: Its not a problem with ZScheduler, it a problem that no one has written a plug-in logging system that is good enough for what you are trying to do. The existing zLOG API is fine (well - it could be better), but just needs someone to write the relevant modules. Hmm... I think I'll add a section to the Interfaces Wiki... Hm... this could work well with Observer-Observable, too. Imagine firing ObservableEvents, and subscribing a "Log" object to them... Agreed; I see this as by far the best approach. It's a tried and true pattern. Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Logging for ZScheduler?
At 12:42 PM 6/15/00 -0400, Shane Hathaway wrote: Agreed; I see this as by far the best approach. It's a tried and true pattern. Not only that, but it gives you extremely fine-grained control over what you do and don't log. And, if the other events like adds and deletes on folders are in place, you can make a monitoring object that notices when new things are added, and subscribes the logger to them... ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Logging for ZScheduler?
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Stuart 'Zen' Bishop Sent: Wednesday, June 14, 2000 20:58 To: Loren Stafford On Wed, 14 Jun 2000, Loren Stafford wrote: I need some advise for designing a flexible system for logging the activities of scheduled events. You could just call Zope's logging system and move it out of the scope of your product. Have a look at zLOG.py or LOGGING.txt if you havn't already. Means people can extend their logging system to their hearts content with no effect on your product. ZScheduler already uses zLOG.LOG. I guess I forgot that it permits implementations other than stupid_log. So I guess ZScheduler is as flexible as can be, given the current API. But ZScheduler also needs to be ISP independent. That is, you should have complete scheduling capabilities for your cohosted Zope applications without having to call up the ISP and ask for system configuration changes. This could be achieved with a seperate product. A product that ties into Zope's logging infrastructure and allows viewing the log files through the web. All it would have to do is append itself to the ZLogger.loggers tuple, and the interface is pretty trivial. And of course, it means that other products can use it without modification (Logger product, Zope itself etc.) and can be extended as required without having to submit patches to you for inclusion in ZScheduler. Aha! Even tho a cohosted account might not be able to modify the source of the Zope implementation directly, installing a CustomLog product could do so indirectly, by importing ZLogger and modifying the loggers tuple. To know where to write the log file, CustomLog would have to either know or be configurable enough to adapt to the ISP's Zope configuration. I suppose an absolute path property would be suffient. An ISP could preconfigure and preinstall the CustomLog product for all users, or each user could do it. It would be a good idea if there was a field in the ZEvent that defined the subsystem used in the zLOG call. I didn't follow your point here. By "subsytem" do you mean which logger in the loggers tuple? Then do you mean that different ZEvents could log to different loggers? Why would this be a "good idea", I mean, do you have a use case in mind? -- Thanks -- Loren ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Logging for ZScheduler?
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Phillip J. Eby Sent: Wednesday, June 14, 2000 21:21 To: [EMAIL PROTECTED]; Loren Stafford At 01:58 PM 6/15/00 +1000, Stuart 'Zen' Bishop wrote: Its not a problem with ZScheduler, it a problem that no one has written a plug-in logging system that is good enough for what you are trying to do. The existing zLOG API is fine (well - it could be better), but just needs someone to write the relevant modules. Hmm... I think I'll add a section to the Interfaces Wiki... Hm... this could work well with Observer-Observable, too. Imagine firing ObservableEvents, and subscribing a "Log" object to them... Cool! Then the logging operation would become a part of the scheduled event thread and transaction instead of part of the Dispatcher's thread (a possibly transaction). I'll have to think about the implications of that. Where is Observer-Observable in the development plan? ZPatterns 0.4? -- Loren ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Logging for ZScheduler?
On Thu, 15 Jun 2000, Loren Stafford wrote: It would be a good idea if there was a field in the ZEvent that defined the subsystem used in the zLOG call. I didn't follow your point here. By "subsytem" do you mean which logger in the loggers tuple? Then do you mean that different ZEvents could log to different loggers? Why would this be a "good idea", I mean, do you have a use case in mind? from zLOG.py: def LOG(subsystem, severity, summary, detail='', error=None, reraise=None): The first argument specifies a subsystem, which is passed to the logging implementation. A logging subsystem may choose to ignore log messages from particular subsystems, or perform special actions (eg. if a critical error has occured in the ZScheduler subsystem, page the sysadmin). By allowing an individual ZEvent to override the subsystem reported, you can gain even more control. -- Stuart Bishop Work: [EMAIL PROTECTED] Senior Systems Alchemist Play: [EMAIL PROTECTED] Computer Science, RMIT University ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Logging for ZScheduler?
- Original Message - From: "Loren Stafford" [EMAIL PROTECTED] To: "Phillip J. Eby" [EMAIL PROTECTED]; [EMAIL PROTECTED]; "Loren Stafford" [EMAIL PROTECTED] Cc: "zope-dev" [EMAIL PROTECTED] Sent: Thursday, June 15, 2000 4:40 PM Subject: RE: [Zope-dev] Logging for ZScheduler? Cool! Then the logging operation would become a part of the scheduled event thread and transaction instead of part of the Dispatcher's thread (a possibly transaction). I'll have to think about the implications of that. Where is Observer-Observable in the development plan? ZPatterns 0.4? Actually, it's in Zope 2.2... It was checked into CVS a few days back. Kevin ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Logging for ZScheduler?
At 01:58 PM 6/15/00 +1000, Stuart 'Zen' Bishop wrote: Its not a problem with ZScheduler, it a problem that no one has written a plug-in logging system that is good enough for what you are trying to do. The existing zLOG API is fine (well - it could be better), but just needs someone to write the relevant modules. Hmm... I think I'll add a section to the Interfaces Wiki... Hm... this could work well with Observer-Observable, too. Imagine firing ObservableEvents, and subscribing a "Log" object to them... ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )