#!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
import logging.handlers
logging.basicConfig(filename='/tmp/logger.log', level=logging.DEBUG)
log = logging.getLogger("test_logge_name")
syslog_handler = logging.handlers.SysLogHandler(address="/dev/log", facility=logging.handlers.SysLogHandler.LOG_LOCAL1)
#syslog_handler.setLevel(logging.WARNING)
log.addHandler(syslog_handler)
log.debug('Test Debug message')
log.info('Test Info message')
log.warning('Test Warning message')
log.error('Test Error message')
log.critical('Test Critical message')
Recommended Posts