Have a way to collect the logs of my jobs?

Today I work on a project with some intermittent tests and I want to measure this so that I can make a decision on the best way to solve it.

Can I list all broken jobs and download the logs?

Hi Lucio,

Welcome to CircleCI Discuss! Currently, we do not natively have a way to access logs programmatically, but it’s pretty easy to create a solution to do this.

      - run: echo << pipeline.parameters.trigger-string >> | tee -a output.txt
      - store_artifacts:
          path: ./output.txt
          destination: output.txt

Keep in mind tee could impact performance by a noticeable bit considering it is acting as the intermediate buffer between stdout and the file. Depending on your use-case, it may not be a big deal as tests take time to complete anyways. You would then be able to receive the job’s output artifacts and test metadata through the API.

Get Artifacts: https://circleci.com/docs/api/v2/#operation/getJobArtifacts
Get Tests: https://circleci.com/docs/api/v2/#operation/getTests

I hope that helps!