pmalafosse commented on issue #17038:
URL: https://github.com/apache/airflow/issues/17038#issuecomment-881308665
I tried locally and my proposal would be like that:
```
def _last_log_messages(self, number_messages):
try:
logs = [log["message"] for log in self._cloudwatch_log_events()]
return "\n".join(logs[-number_messages:])
except IndexError:
return None
def _last_log_message(self):
return self._last_log_messages(1)
...
raise AirflowException(f"This task is not in success state - last logs from
Cloudwatch: \n{self._last_log_messages(10)}")
```
--
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]