1import logging
2import logging.handlers
3
4my_logger = logging.getLogger('MyLogger')
5my_logger.setLevel(logging.DEBUG)
6
7handler = logging.handlers.SysLogHandler(address = '/dev/log')
8
9my_logger.addHandler(handler)
10
11my_logger.debug('this is debug')
12my_logger.critical('this is critical')