Am Thu, 29 Jun 2006 20:22:28 -0700 schrieb ss2003:
> hi
> i have defined a function
> def logger(logfile,msg):
> import logging
>
> logging.basicConfig(level=logging.DEBUG,
>format='%(asctime)s %(levelname)-8s
> %(message)s',
>
hi
i have defined a function
def logger(logfile,msg):
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(levelname)-8s
%(message)s',
datefmt='%a, %d %b %Y %H:%M:%S',
> but now I'd like to understand the design rational behind having each
> logger in the object hierarchy log the same output by default. Anyone?
Loggers are different to handlers. Loggers map to areas of the
application, handlers map to output destinations. Loggers form a
hierarchy based on names
Ok, so I've figured this out (see below),
mail = logging.handlers.SMTPHandler('mail.vw.com',
'[EMAIL PROTECTED]',
'[EMAIL PROTECTED]',
'Data Processing Error at
location: %s' %
I want to create two different loggers so that users see one output
(e.g. no exception/stack traces) and others (e.g support staff) that
does see stack traces via email. The code below is close but I still
get console output on the email logger from the "root" logger. How do
I get rid of it?
im