Python logging: Can I pass arguments to a custom handler in json config file
问题 Ive read the docs, but did not find any mention of this. Is it possible to pass parameters to a custom logging.handler class inside a json configuration file? "handlers": { "custom_handler": { "class": "logging.CustomHandler", "args": ['a', 'b'] # <------------------------ "level": "INFO", "formatter": "custom" } }, Where the handler class definition is : class CustomHandler(logging.Handler): def __init__(self, argA, argB): super().__init__() self.a = argA self.b = argB def emit(self, record)