[Zope-dev] Re: Mailing Log Entries in 2.7

2004-05-05 Thread Chris Withers
Fred Drake wrote:
That's not currently possible, though it wouldn't be hard to add.  Perhaps 
some future ZConfig revision would add this.
Surely ZConfig alredy allows this, it's just Zope's use of ZConfig that needs to 
support it?

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: Mailing Log Entries in 2.7

2004-05-05 Thread Fred Drake
Regarding putting more information in email's generated using email-notifier 
sections, I wrote:
  That's not currently possible, though it wouldn't be hard to add. 
  Perhaps some future ZConfig revision would add this.

On Wednesday 05 May 2004 05:41 am, Chris Withers responded:
  Surely ZConfig alredy allows this, it's just Zope's use of ZConfig that
  needs to support it?

The configuration of the logging is handled using a ZConfig component that's 
actually bundled with ZConfig itself on the Zope 2 head; it's in the package 
ZConfig.components.logger.  This allows any project using ZConfig to use the 
same basic logging support; we actually have several projects using ZConfig 
outside the application server.


  -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 )


[Zope-dev] Re: Mailing Log Entries in 2.7

2004-05-05 Thread Chris Withers
Fred Drake wrote:

The configuration of the logging is handled using a ZConfig component that's 
actually bundled with ZConfig itself on the Zope 2 head; it's in the package 
ZConfig.components.logger.  This allows any project using ZConfig to use the 
same basic logging support; we actually have several projects using ZConfig 
outside the application server.
Cool. Okay, quick question for you...

I'm trying to set up some (normal python) logging so that run of the mill 
messages are send to a logfile while critical errors are sent via email to me. I 
got to:

import logging
logger = logging.getLogger('X2Y')
hdlr = logging.FileHandler(logfile)
formatter = logging.Formatter('%(asctime)s %(process)d %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
if len(sys.argv)==2 and sys.argv[1]=='debug':
logger.setLevel(logging.DEBUG)
else:
logger.setLevel(logging.INFO)
hdlr = logging.SMTPHandler(*etc*)
formatter = logging.Formatter('%(asctime)s 
%(process)d\n\n%(message)s\n\n%(pathname)s line %(lineno)d.')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)

...but then couldn't figure out how to say that the SMTPHandler should only deal 
with messages that are critical.

Any ideas?

Bringing this back on topic, I'd also be very interested in doing the same thing 
for Zope instances...

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: Mailing Log Entries in 2.7

2004-04-25 Thread Fred Drake
On Saturday 24 April 2004 06:26 pm, Chris Withers wrote:
  And there was me looking forward to writing a product that added its own
  ZConfig section :'(

You still can if you like.  ;-)

  Okay, how can I get the log level and exception type into the subject?

That's not currently possible, though it wouldn't be hard to add.  Perhaps 
some future ZConfig revision would add 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 )