How do I download output logs?

I know there’s a way to download the first 4mb of outputs from each step, however I can’t find a way to do it (in Circleci.v1)

Much obliged!

Victor.

Hey Victor,

You have to get them via the API. A single build returns the output_url for each step which will show you all of the build output.

https://circleci.com/docs/api/v1-reference/#build

For example. This is a public project of mine: https://circleci.com/api/v1.1/project/github/levlaz/blog/90

Please note you must include the API token in order to see the logs on S3.

Hm, I tried it and don’t see the actual terminal outputs from the build steps.

Right, you won’t see them. They are stored on S3, you need to download each one.

Please note you must include the API token in order to see the logs on S3.

I passed the circle-token arg (btw - I just realize how extremely unsafe this is! please change it to a POST request with body args or a GET request with a header. I’ll make another improvement request for that) and don’t see the S3 link for the logs in the response.

@vivricanopy I’ve created a utility for downloading the CircleCI build test output to file, so if you still have issues you can try it out.

You can also integrate it into Circle build process so that it goes to artifacts like here:

.

1 Like

This works for me.

curl -s $(curl -sku $token: https://circleci.com/api/v1.1/project/${vcs}/${user}/${project}/$(curl -sku $token: https://circleci.com/api/v1.1/project/${vcs}/${user}/${project}?filter=failed | jq -r '.[0] | .build_num')| jq -r '.steps[] | select(.actions | select( .[] | .failed==true)) | .actions[] | .output_url' ) | gzip -dc| jq -r '.[] | .message'

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.