【在python中,将日志记录和ncurses转到单独的TTY】教程文章相关的互联网学习教程文章

如何在Python中配置到syslog的日志记录?【代码】

我无法理解Python的日志记录模块.我的需求非常简单:我只想将所有内容记录到syslog中.阅读文档后,我想出了这个简单的测试脚本:import logging import logging.handlersmy_logger = logging.getLogger('MyLogger') my_logger.setLevel(logging.DEBUG)handler = logging.handlers.SysLogHandler()my_logger.addHandler(handler)my_logger.debug('this is debug') my_logger.critical('this is critical')但是此脚本不会在syslog中生...