ashb commented on code in PR #48491:
URL: https://github.com/apache/airflow/pull/48491#discussion_r2022365407
##########
providers/amazon/src/airflow/providers/amazon/aws/log/cloudwatch_task_handler.py:
##########
@@ -62,6 +72,142 @@ def json_serialize(value: Any) -> str | None:
return watchtower._json_serialize_default(value)
[email protected](kw_only=True)
+class CloudWatchRemoteLogIO(LoggingMixin): # noqa: D101
+ base_log_folder: Path = attrs.field(converter=Path)
+ remote_base: str = ""
+ delete_local_copy: bool = True
+
+ log_group_arn: str
+ log_stream_name: str = ""
+ log_group: str = attrs.field(init=False, repr=False)
+ region_name: str = attrs.field(init=False, repr=False)
+
+ @log_group.default
+ def _(self):
+ return self.log_group_arn.split(":")[6]
+
+ @region_name.default
+ def _(self):
+ return self.log_group_arn.split(":")[3]
+
+ @cached_property
+ def hook(self):
+ """Returns AwsLogsHook."""
+ return AwsLogsHook(
+ aws_conn_id=conf.get("logging", "remote_log_conn_id"),
region_name=self.region_name
+ )
+
+ @cached_property
+ def handler(self) -> watchtower.CloudWatchLogHandler:
+ _json_serialize = conf.getimport("aws",
"cloudwatch_task_handler_json_serializer", fallback=None)
+ return watchtower.CloudWatchLogHandler(
+ log_group_name=self.log_group,
+ log_stream_name=self.log_stream_name,
+ use_queues=True,
Review Comment:
The previous value was `use_queues=not getattr(ti, "is_trigger_log_context",
False),`. i.e. queues were used everywhere but triggers? But the trigger
logging has already been changed ~1 month ago no not set that context, so
queues were used everywhere.
I can make this configurable?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]