烧瓶记录处理程序信息

时间:2020-07-09 08:19:53

标签: python flask logging handler

我在flask应用程序中配置了两个日志处理程序。如何获取应用程序正在使用的处理程序名称,以便据此我将处理日志记录。

1 个答案:

答案 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是相同的参考