将日志写入阿里云 OSS

远程记录日志到阿里云 OSS 使用现有的 Airflow 连接来读取或写入日志。如果您没有正确设置连接,此过程将失败。

启用远程日志记录

要启用此功能,必须按如下方式配置 airflow.cfg

[logging]
# Airflow can store logs remotely in Alibaba OSS. Users must supply a remote
# location URL (starting with either 'oss://...') and an Airflow connection
# id that provides access to the storage location.
remote_logging = True
remote_base_log_folder = oss://my-bucket/path/to/logs
remote_log_conn_id = oss_default

在上面的示例中,Airflow 将尝试使用 OSSHook('oss_default')

此条目有帮助吗?