'Configure output handlers'

def configure_logger(self):

    if hasattr(current, 'log'):
        return
    settings = current.deployment_settings
    console = settings.get_log_console()
    logfile = settings.get_log_logfile()
    if ((not console) and (not logfile)):
        self.critical = self.error = self.warning = self.info = self.debug = self.ignore
        return
    logger = logging.getLogger(__name__)
    logger.propagate = False
    logger.setLevel(self.log_level)
    logger.handlers = []
    m_format = '%(asctime)s    %(caller)s    %(levelname)s:    %(message)s'
    d_format = '%Y-%m-%d    %H:%M:%S'
    formatter = logging.Formatter(m_format, d_format)
    if console:
        console_handler = logging.StreamHandler(sys.stderr)
        console_handler.setFormatter(formatter)
        console_handler.setLevel(self.log_level)
        logger.addHandler(console_handler)
    if logfile:
        from logging.handlers import RotatingFileHandler
        MAXBYTES = 1048576
        logfile_handler = RotatingFileHandler(logfile, maxBytes=MAXBYTES, backupCount=3)
        logfile_handler.setFormatter(formatter)
        logfile_handler.setLevel(self.log_level)
        logger.addHandler(logfile_handler)
    return
