将日志添加到气流日志

编程入门 行业动态 更新时间:2024-10-08 03:44:54
本文介绍了将日志添加到气流日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何将自己的日志添加到自动生成的Apache Airflow日志中?任何打印语句都不会在那里登录,所以我想知道如何添加日志以使其也显示在UI上?

How can I add my own logs onto the Apache Airflow logs that are automatically generated? any print statements wont get logged in there, so I was wondering how I can add my logs so that it shows up on the UI as well?

推荐答案

我认为您可以通过使用日志记录模块并将配置信任于Airflow来解决此问题.

I think you can work around this by using the logging module and trusting the configuration to Airflow.

类似的东西:

import ... dag = ... def print_params_fn(**kwargs): import logging logging.info(kwargs) return None print_params = PythonOperator(task_id="print_params", python_callable=print_params_fn, provide_context=True, dag=dag)

更多推荐

将日志添加到气流日志

本文发布于:2023-11-23 21:41:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622930.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:日志   气流

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!