loggin

Ajay abra9823 at mail.usyd.edu.au
Sat Aug 28 02:35:30 EDT 2004


hi!

in my web app. i log debug messages to a file. however, sometimes the
messages appear more than once even though the code in which the log
statement appears gets executes only once
i have a utilities.py file which defines a getLogger() method as follows

logger = logging.getLogger('../logs/umapp')
hdlr = logging.FileHandler('../logs/umapp.log')
os.system("chmod 755 ../logs/umapp.log")
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.INFO)
return logger

all my cgi scripts the the start make the call - logger =
utilities.getLogger()

the scripts then log debug messages during different stages of their
execution.

however, some of these debug messages appear 2 or 3 times on the log file.
i have verified that the particular code block in which the log statement
is present is executed only once

any ideas

thanks
cheers



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the Python-list mailing list