A
Ajay
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
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