Is it possible to get the raw build log from a TeamCity build? I've written a custom test runner that gets run as a commandline build step and reports test results back by printing ##teamcity...
lines to stdout. The build log from TeamCity seems to be stripping these out when it recognises them. I'd like to see the raw output to help debug my test runner.
Update: Apparently this simply isn't possible. neverov (I assume Dimitry Neverov of JetBrains?) has explained this and given a workaround so I've accepted his answer.
To view the history of builds in the current configuration, click previous and next links in the upper right corner of Build Results. Click All history link to open the History tab.
On the menu bar, choose Tools > Options. On the Projects and Solutions page, choose the Build and Run page. In the MSBuild project build output verbosity list, choose one of the following values, and then choose the OK button. Displays a summary of the build only.
A build log is an enhanced console output of a build. It is represented by a structured list of the events which took place during the build. Generally, it includes entries on TeamCity-performed actions and the output of the processes launched during the build.
You can also enable automatic cleaning the sources before every build, if you check the option Clean all files before build on the Create/Edit Build Configuration> Version Control Settings page. If this option is checked, TeamCity performs a full checkout before each build.
You can download it by clicking "Download full build log" on build log page.
Great answers here before me. I would add that your TeamCity master holds log files for the builds, and you can get them on the command line.
Have a look in <TeamCity Data Directory>/system/artifacts/<project ID>/<build configuration name>/<internal_build_id>/.teamcity/logs
.
This mattered to me because
You can see the raw output from the build agent by looking in the agents /logs
directory. This shows the unparsed data that is being hidden on the build output shown in the TeamCity console.
For example c:\TeamCity-Agent\logs\teamcity-build.log
.
I see that this question was asked long time ago (almost 10 years ago) but nothing changed in TeamCity.
I faced similar issue with test reporter and found a way to get raw log without connecting to build agent and getting it from there (it may be difficult). My solution does not cover the whole build log, but can be helpful when step is run via custom script in Build Steps.
So the solution is to add | tee e2e_raw.log
into required build step script. For example we run tests in Docker by running docker-compose command:
tee
will duplicate all the output into the file. Original output will be the same and will be parsed by TeamCity as usual.
You should also add a line into artifacts field to make build able to collect newly created artifact (Build General settings):
After that you will see a new archive in artifacts tab with raw log for this build step:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With