Hi,
I get the log messages 'twice' on the console and only once in the log file.
Can any one tell me the reason for this duplication on console?
here is how I have set the logger:
import logging
#--set up logging to file
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%Y-%m-%d %H:%M',
filename='linkconfig_log.txt',
filemode='a')
#--defines a handler which writes DEBUG messages or higher to sys.stdout
console=logging.StreamHandler()
console.setLevel(logging.DEBUG)
#--setting a format which is simpler for console use
formatter=logging.Formatter('%(levelname)-8s %(message)s')
#--tell the handler to use this format
console.setFormatter(formatter)
#--add handler to the root logger
logging.getLogger('').addHandler(console)
help please