import logging as log
log.basicConfig(handlers=[log.FileHandler(FILE_DIR+'log.log', 'a', 'utf-8')],
level=log.DEBUG, format="%(asctime)s:%(levelname)s:%(message)s")
import logging
# create logger with 'spam_application'
logger = logging.getLogger('MyApp')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
fd = logging.FileHandler('MyApp_Debug.log')
fd.setLevel(logging.DEBUG)
# create file handler which logs even error messages
fe = logging.FileHandler('MyApp_Error.log')
fe.setLevel(logging.ERROR)
# add the handlers to the logger
logger.addHandler(fd)
logger.addHandler(fe)
logger.debug('test message debug')
logger.error('test message error')