Python logging with rsyslog
问题 I've inherited the following python file: import logging from logging.handlers import SysLogHandler class Logger(object): # Return a logging instance used throughout the library def __init__(self): self.logger = logging.getLogger('my_daemon') # Log an info message def info(self, message, *args, **kwargs): self.__log(logging.INFO, message, *args, **kwargs) # Configure the logger to log to syslog def log_to_syslog(self): formatter = logging.Formatter('my_daemon: [%(levelname)s] %(message)s')