Re: [Zope-dev] Re: zLOG changes
Fred Drake wrote: On Wednesday 21 April 2004 04:48 am, Chris Withers wrote: I'm guessing there is some kind of log-to-console logger already? If so, why not just add that in zope.conf and comment it out when you move to production? That would work for me, but not everyone at ZC agreed, so I've made some changes that should be good for most people; see my message to Andreas and (and Zope-Dev) for a description of how things work on the trunk now. What were their arguments? What you've implemented feels automagical to me (a word that makes me want to throw spikey objects at whoever uses it, second only to authentification) and I wholeheartedly echo Dieter's comments further down in the thread... Would-be-great-to-be-explicit-and-more-configurable-ly yours, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: zLOG changes
Fred Drake wrote at 2004-4-22 17:15 -0400: I wrote: - In debug mode, add a new handler that dumps to standard output. This is fairly easy to code, but is inflexible. Andreas responded: But flexible enough for most usecase. The point is that you want to see the tracebacks on the console during the development phase. Watching the event.log with tail -f is somewhat annoying. Understood! I've committed changes that that I think should do the trick for you. - In debug mode, a log handler is added to the root logger that writes events to standard error. This is no longer conflated with the startup logging. Hopefully, you do this not automatically? While one *sometimes* wants messages on the console, *often* one does not. This means, it should be a configuration option. - When running Zope using zopectl fg (the best way to run things for debugging), zopectl will force debug mode to be enabled. I do not think this coupling is good. You might have problems in production mode that you do not have in development mode. - In debug mode, use an alternate or auxillary logging configuration to replace or augment the eventlog configuration section. This is more work up front, but keeps everything flexible. I like this much more... -- Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: zLOG changes
I wrote: - In debug mode, add a new handler that dumps to standard output. This is fairly easy to code, but is inflexible. Andreas responded: But flexible enough for most usecase. The point is that you want to see the tracebacks on the console during the development phase. Watching the event.log with tail -f is somewhat annoying. Understood! I've committed changes that that I think should do the trick for you. - In debug mode, a log handler is added to the root logger that writes events to standard error. This is no longer conflated with the startup logging. - When running Zope using zopectl fg (the best way to run things for debugging), zopectl will force debug mode to be enabled. - In debug mode, use an alternate or auxillary logging configuration to replace or augment the eventlog configuration section. This is more work up front, but keeps everything flexible. Maybe too much overkill...not sure if one needs an academic solution here... I don't know that I'd describe this as academic (most academics I've worked with considered the ability to change the code configuration enough), but if you're happy not to need it, I'm happy not to implement it. ;-) -Fred -- Fred L. Drake, Jr. fred at zope.com PythonLabs at Zope Corporation ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: zLOG changes
On Wednesday 21 April 2004 04:48 am, Chris Withers wrote: I'm guessing there is some kind of log-to-console logger already? If so, why not just add that in zope.conf and comment it out when you move to production? That would work for me, but not everyone at ZC agreed, so I've made some changes that should be good for most people; see my message to Andreas and (and Zope-Dev) for a description of how things work on the trunk now. BTW, is there a logger in Python 2.3/Zope 2.7 that sends log entries via email? If not, I'll port MailingLogger to Zope 2.7 and see if I can make it play nice :-) Yes, there is. You should be able to use it by adding a section like this inside your eventlog section in zope.conf: email-notifier fromChris Withers [EMAIL PROTECTED] to [EMAIL PROTECTED] to [EMAIL PROTECTED] subject Something blew up! smtp-server [EMAIL PROTECTED] level error format Timestamp: %(asctime)s\nComponent: %(name)s\nLevel: %(levelname)s (%(levelno)s)\n\n%(message)s /email-notifier My mailer might have wrapped that long line; sorry. ;-( Let me know if there are any problems with this. -Fred -- Fred L. Drake, Jr. fred at zope.com PythonLabs at Zope Corporation ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: zLOG changes
--On Dienstag, 20. April 2004 17:19 Uhr -0400 Fred Drake [EMAIL PROTECTED] wrote: - when adding LOG = getLogger(...) LOG.info(...) to some modules then the output is only written to the event.log but no longer to stdout (if running in debug mode). Is this change intentional? I'm not sure what the right approach to fixing this is. There are a couple of choices: - In debug mode, add a new handler that dumps to standard output. This is fairly easy to code, but is inflexible. But flexible enough for most usecase. The point is that you want to see the tracebacks on the console during the development phase. Watching the event.log with tail -f is somewhat annoying. - In debug mode, use an alternate or auxillary logging configuration to replace or augment the eventlog configuration section. This is more work up front, but keeps everything flexible. Maybe too much overkill...not sure if one needs an academic solution here... Andreas ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: zLOG changes
Andreas Jung wrote: - In debug mode, use an alternate or auxillary logging configuration to replace or augment the eventlog configuration section. This is more work up front, but keeps everything flexible. Maybe too much overkill...not sure if one needs an academic solution here... I'm guessing there is some kind of log-to-console logger already? If so, why not just add that in zope.conf and comment it out when you move to production? That seems both flexible and sensible to me, and with no work :-) BTW, is there a logger in Python 2.3/Zope 2.7 that sends log entries via email? If not, I'll port MailingLogger to Zope 2.7 and see if I can make it play nice :-) cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: zLOG changes
Andreas Jung wrote: --On Dienstag, 20. April 2004 17:19 Uhr -0400 Fred Drake [EMAIL PROTECTED] wrote: - when adding LOG = getLogger(...) LOG.info(...) to some modules then the output is only written to the event.log but no longer to stdout (if running in debug mode). Is this change intentional? I'm not sure what the right approach to fixing this is. There are a couple of choices: - In debug mode, add a new handler that dumps to standard output. This is fairly easy to code, but is inflexible. But flexible enough for most usecase. The point is that you want to see the tracebacks on the console during the development phase. Watching the event.log with tail -f is somewhat annoying. $ zopectl zopectl fg export EVENT_LOG_FILE EVENT_LOG_FILE= /home/tseaver/projects/SFASP/var/zope/bin/runzope -- 2004-04-21T15:37:01 INFO(0) ZServer HTTP server started at Wed Apr 21 15:37:01 2004 Hostname: quervo.zope.com Port: 28080 -- 2004-04-21T15:37:01 INFO(0) ZServer FTP server started at Wed Apr 21 15:37:01 2004 Hostname: quervo.zope.com Port: 28021 -- -- 2004-04-21T15:37:10 INFO(0) Zope Ready to handle requests Why use the console, when you have zopectl? -- === Tres Seaver[EMAIL PROTECTED] Zope Corporation Zope Dealers http://www.zope.com ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: zLOG changes
On Tuesday 20 April 2004 01:22 pm, Andreas Jung wrote: - the entries in the event.log are currently written without the log level. Is this dedicated behaviour? I think the log level should be part of the event.log It should. This was lost when I changed the zLOG -- logging mapping, and was unintentional. I've changed the default logging formats for each handler type to do what seems to be the right thing. The specific formats can be controlled via the format setting in the relevant log handler sections in zope.conf. - when adding LOG = getLogger(...) LOG.info(...) to some modules then the output is only written to the event.log but no longer to stdout (if running in debug mode). Is this change intentional? I'm not sure what the right approach to fixing this is. There are a couple of choices: - In debug mode, add a new handler that dumps to standard output. This is fairly easy to code, but is inflexible. - In debug mode, use an alternate or auxillary logging configuration to replace or augment the eventlog configuration section. This is more work up front, but keeps everything flexible. -Fred -- Fred L. Drake, Jr. fred at zope.com PythonLabs at Zope Corporation ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )