【问题标题】:Apache Airflow - Bash Operator success but with warning about log4jApache Airflow - Bash Operator 成功但带有关于 log4j 的警告
【发布时间】:2018-11-27 00:06:19
【问题描述】:

我正在运行Aiflow 1.9 我运行了一个执行 BashOperator

的 DAG
bash_command="python /home/ubuntu/airflow/scripts/b.py "

一切都很好,但是当我查看我的任务日志时,我看到了这些:

[2018-06-17 08:00:10,273] {base_task_runner.py:98} INFO - Subtask: [2018-06-17 08:00:10,272] {bash_operator.py:101} INFO - log4j:WARN No appenders could be found for logger (com.amazonaws.athena.jdbc.AthenaDriver).
[2018-06-17 08:00:10,273] {base_task_runner.py:98} INFO - Subtask: [2018-06-17 08:00:10,273] {bash_operator.py:101} INFO - log4j:WARN Please initialize the log4j system properly.
[2018-06-17 08:00:10,273] {base_task_runner.py:98} INFO - Subtask: [2018-06-17 08:00:10,273] {bash_operator.py:101} INFO - log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

似乎是 Airflow Apache 未处理的问题?

【问题讨论】:

    标签: log4j airflow


    【解决方案1】:

    您是否尝试过生成自定义 log4j XML 配置文件并直接指向它?

    You may find this answer helpful.

    编辑:正如在其他问题中所见,警告似乎与 AWS Athena JDBC 有关。气流记录器可能足够冗长,可以将其拾取,但警告本身与它无关。

    【讨论】:

    • 我什至不知道 log4j 是什么。我安装了 Airflow,根据指南进行配置并运行脚本。气流文档甚至没有提到 log4j。此警告是由 Airflow 而不是我的脚本创建的。
    • 您确定这些日志与您尝试连接到 AWS Athena 的事实无关吗?如果我没记错的话,log4j 是由 Athena JDBC 使用的。 Here 你可以在不同的上下文中看到相同的警告,唯一不变的是使用 AWS Athena。
    • 我正在尝试连接到 AWS Athena。这就是我的脚本所做的。但是,当我手动运行它时,我没有收到这样的警告。当 Airflow 为我运行时 - 我收到警告。
    • Airflow 由于某种原因无法访问配置,或者很可能是冗长问题。
    • 但是可以。该脚本有效。它只是显示交战。我假设这是 Airflow 中的一个错误。我们如何报告此问题?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-12
    • 1970-01-01
    • 2021-11-02
    • 1970-01-01
    • 2016-01-23
    • 2020-07-23
    相关资源
    最近更新 更多