Python Logging: dictConfig

前端 未结 2 840
慢半拍i
慢半拍i 2021-01-22 16:27

I am trying to use a config file for configure Python Logging, but also adding handlers after the dict config has been loaded. SO my config file is like

version:         


        
2条回答
  •  既然无缘
    2021-01-22 16:50

    Ohh I figure it out. What I need to do is

    formatter =logging.Formatter(log_config_dict['formatters']['plain_formatter']['format'])             
    fhandler1.setFormatter(formatter)
    

    So, I need to create a Formatter object.

提交回复
热议问题