# How to export training logs from CloudWatch

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-export-training-logs-from-cloudwatch%2F12698%3E%5C
**Category:** Amazon SageMaker\
**Created:** [December 10, 2021, 1:24pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-export-training-logs-from-cloudwatch%2F12698 "2021-12-10T13:24:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierreguillou](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pierreguillou/32/19626_2.png) [@pierreguillou](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fpierreguillou)%5C
**Post date:** [December 10, 2021, 1:24pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-export-training-logs-from-cloudwatch%2F12698%2F1 "2021-12-10T13:24:42Z")

</div>

Hi,

When I launch a model training in `AWS SageMaker & HF Training DLC`, there is a `training job` created in `AWS SageMaker` that has a link to `CloudWatch > Logs > Logs groups > /aws/sagemaker/TrainingJobs > job name of my training > Log events` where I can see the logs of my training.

Great.

**Now, I would like to export all these logs to a `txt` file.** Strange but I do not see a button for that.

Who knows how to do it? Thanks.

---

<div class="post-metadata">

**Author:** ![OlivierCR](https://avatars.discourse-cdn.com/v4/letter/o/b19c9b/32.png) [@OlivierCR](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FOlivierCR)%5C
**Post date:** [December 13, 2021, 10:17am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-export-training-logs-from-cloudwatch%2F12698%2F2 "2021-12-13T10:17:46Z")

</div>

Hi! you can either export logs to S3 via the log export feature:

[https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/S3ExportTasksConsole.html](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/S3ExportTasksConsole.html)

You can also query the logs via SDK, for example [CloudWatchLogs — Boto3 Docs 1.20.23 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs.html#CloudWatchLogs.Client.filter_log_events)
