<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def configure(name, logfile, loglevel=logging.DEBUG):
 """Create a python logger instance and configure it. Parameters name : str Logger name. logfile : str Path to the log file. loglevel : int Default log level for STDOUT. """


        #        logging.config.dictConfig({
        #                'version': 1,
        #                'disable_existing_loggers': False})

        logger = logging.getLogger(name)

        # Don't propagate to root logger
        logger.propagate = False
        logger.setLevel(logging.DEBUG)

        datefmt = '%Y-%m-%d %H:%M:%S'
        format_stream = ('%(asctime)s %(levelname)-8s'
                         '%(name)s.%(funcName)s(): %(message)s')
        format_file = ('%(asctime)s %(levelname)-8s'
                       '%(name)s.%(funcName)s(): %(message)s')
#        format_file = ('%(asctime)s %(levelname)-8s '
#                       '%(name)s.%(funcName)s() '
#                       '[%(filename)s:%(lineno)d]: %(message)s')

        if not logger.handlers:

            # Add a file handler
            if logfile is not None:
                logfile = logfile.replace('.log', '') + '.log'
                fh = logging.FileHandler(logfile)
                fh.setLevel(logging.DEBUG)
                fh.setFormatter(logging.Formatter(format_file, datefmt))
                logger.addHandler(fh)

            # Add a stream handler
            ch = logging.StreamHandler()
            ch.setLevel(loglevel)
            ch.setFormatter(logging.Formatter(format_stream, datefmt))
            logger.addHandler(ch)
        else:
            logger.handlers[-1].setLevel(loglevel)

        return logger