BuildMonitor.exe accepts a saved .ib_mon monitor file together with the /exportlog= switch and runs the same export as the menu item, so a CI pipeline produces the same JSON a developer gets from the UI.
Exporting always takes two steps, because a monitor file is only complete once the build it describes has ended:
-
The build writes an
.ib_monfile (BuildConsole /Mon=). -
A separate post-build step converts that file to JSON (
BuildMonitor.exe <file> /exportlog=).
Prerequisite: Basic logging or higher
The build must run with a logging level of Basic or higher. Minimal logging still produces a monitor file, but that file carries no log data to export, and the export fails with:- On the Agent that initiates the build, go to Agent Settings > Agent > General > Logging level and select Basic or higher. See Agent options.
-
Or override it for a single build with the BuildConsole
/LogLevelswitch, for example/LogLevel="Basic".
/LimitBMData=1, 2, and 3 disable Build Monitor data writing. A build run with any of those values produces a monitor file with nothing useful to export, so leave /LimitBMData unset (or 0) on builds whose log you intend to export.Step 1: Save an .ib_mon file during the build
Add/Mon= with a full path to your existing BuildConsole (or xgConsole) command:
- Pass a full filename, not a folder. If the value ends in a backslash, Incredibuild treats it as a folder and generates a GUID for the filename — the next step then has no predictable path to read.
-
The
.ib_monextension is added for you if you leave it off. -
$(Title)is expanded in the path, so you can produce per-build filenames when the same command also passes/Title=.
Step 2: Export the JSON after the build
Run the export as its own pipeline step, after the build step has finished:-
Run it after the build, as a separate step. The
.ib_monfile is not finalized until the build ends, so the export cannot be folded into the build command. -
Run it even when the build fails — a failed build is usually the one whose log you want. Use
if: always()in GitHub Actions,condition: always()in Azure DevOps, and wrap the build intry/finallyin Jenkins. -
start /wait ""is required.BuildMonitor.exeis a GUI application, so invoking it directly returns immediately and the next pipeline step runs against a JSON file that has not been written yet. The empty""is the window title thatstartexpects — without it,starttreats the quoted path to the executable as the title and never launches it. -
Put the
.ib_monpath first, unprefixed, and use=for the switch. Written with a space instead of an equals sign,/exportlog C:\out.jsonis silently ignored.
Step 3: Publish the output files
The command writes two files:
Collect both if you want the full picture. The
.zip is optional if you only need the log itself.
Step 4: Verify that the export worked
BuildMonitor.exe does not return a meaningful exit code for this operation. Do not gate the pipeline on %ERRORLEVEL% here — it looks like success either way. Assert on the output file instead:
Build log is not available for this type of monitor file.
Full example: GitHub Actions
This workflow builds, exports the log regardless of the build’s outcome, and uploads both output files. For the rest of the GitHub Actions setup, see Integrating with Github Actions.Choosing between /exportlog and BuildDataExtractor
BuildDataExtractor64.exe also reads an .ib_mon file and also writes JSON, but it is a different tool that emits a different document. It is not a substitute when you need to match what the UI exports.
BuildDataExtractor64.exe is a real console application with meaningful exit codes, which makes it the easier tool to script around. Choose it when you are building your own reporting on top of build data. Choose /exportlog when the requirement is specifically the log file the Build Monitor produces.
Related
- The Build Monitor Overview — what the Build Monitor shows and how the log is used.
-
BuildConsole for Visual Studio — the full
/Mon,/LogLevel, and/LimitBMDatareference. - Exporting Logs to Support — a different workflow, for sending troubleshooting material to Incredibuild support.