How do I download output logs?

api
output

#1

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.


#2

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.


#3

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


#4

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.


#5

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.


#6

@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:

.


#7

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'


#8

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