On 8/21/07, Shiao <[EMAIL PROTECTED]> wrote: > Hi, > I am getting duplicate log entries with the logging module. > > The following behaves as expected, leading to one log entry for each > logged event: > > logging.basicConfig(level=logging.DEBUG, filename='/tmp/foo.log') > > But this results in two entries for each logged event: > > applog = logging.getLogger() > applog.setLevel(logging.DEBUG) > hdl = logging.FileHandler('/tmp/foo.log') > applog.addHandler(hdl) >
You need to remove the handler from the logging object # remove the handler once you are done applog.removeHandler(hdl) Cheers, amit. ---- Amit Khemka website: www.onyomo.com wap-site: www.owap.in Home Page: www.cse.iitd.ernet.in/~csd00377 Endless the world's turn, endless the sun's Spinning, Endless the quest; I turn again, back to my own beginning, And here, find rest. -- http://mail.python.org/mailman/listinfo/python-list