def setupLogger(self):
        logger = logging.getLogger("router")
        #dont't propagate to root logger
        logger.propagate=False
        logger.handlers = []

        consoleHandler = logging.StreamHandler()
        consoleHandler.setLevel(logging.DEBUG)

        # create file handler which logs even debug messages
        dir = os.path.dirname(__file__)
        resultFile = dir + "/../apdu.log"
        fileHandler = logging.FileHandler(resultFile, mode='w')
        fileHandler.setLevel(logging.INFO)

        # create formatter and add it to the handlers
        consoleFormatter = logging.Formatter(fmt='%(message)s')
        fileFormatter = logging.Formatter(fmt='%(asctime)s %(message)s', datefmt='%H:%M:%S')

        consoleHandler.setFormatter(consoleFormatter)
        fileHandler.setFormatter(fileFormatter)

        # add the handlers to the logger
        logger.addHandler(consoleHandler)
        logger.addHandler(fileHandler)

        if extHandler:
            #add handler for test runner
            logger.addHandler(extHandler)
        return logger