且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Apache Airflow-自定义日志记录格式

更新时间:2022-02-28 08:31:12

您需要更改气流包装中的settings.py文件以更改日志格式

You need to change the settings.py file in the airflow package to change the log format


  • 更新 settings.py (在LOGGING_LEVEL之后添加以下行):

  • Update settings.py (after LOGGING_LEVEL add below line):

LOG_FORMAT = os.path.expanduser(conf.get('core','LOG_FORMAT'))

LOG_FORMAT = os.path.expanduser(conf.get('core', 'LOG_FORMAT'))

更新 airflow.cfg 配置文件:
在[core]下添加行:

Update airflow.cfg configuration file: Add line under [core]:

LOG_FORMAT =%(asctime)s logLevel =%(levelname)s logger =%(name)s-%(message)s

LOG_FORMAT = "%(asctime)s logLevel=%(levelname)s logger=%(name)s - %(message)s"

重启网络服务器调度程序服务

尝试使用答案此处更改日志记录级别

Try the approach as mentioned in the answer here to change logging level