将日志写入阿里云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')

此条目有帮助吗?