我在flask应用程序中配置了两个日志处理程序。如何获取应用程序正在使用的处理程序名称,以便据此我将处理日志记录。
答案 0 :(得分:0)
logging.basicConfig(filename=’<yourfilename>.log‘, level=logging.DEBUG, format=’%(asctime)s %(levelname)s %(name)s %(threadName)s : %(message)s’)
在此
%(asctime)s—A timestamp as a string.
%(levelname)s—The logging level as a string.
%(threadName)s—The thread name as a string.
%(message)s’—The log message.
->> %(name)s—The logger name as a string.
here是相同的参考