Skip to content

psandhu79/MSBuildStructuredLog

 
 

Repository files navigation

MSBuildStructuredLog

A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.

Build status NuGet package

Install:

https://github.com/KirillOsenkov/MSBuildStructuredLog/releases/download/v1.0.123/MSBuildStructuredLogSetup.exe

The app updates automatically via Squirrel (after launch it checks for updates in background), next launch starts the newly downloaded latest version.

Screenshot1

Requirements:

  • .NET Framework 4.6
  • MSBuild 14.0 or 15.0
  • Visual Studio 2017 (only needed for development)

Usage:

The logger is in a single file: StructuredLogger.dll. It is available in a NuGet package: https://www.nuget.org/packages/Microsoft.Build.Logging.StructuredLogger

You can either build your solution yourself and pass the logger:

msbuild solution.sln /t:Rebuild /v:diag /noconlog /logger:StructuredLogger,%localappdata%\MSBuildStructuredLogViewer\app-1.0.123\StructuredLogger.dll;1.buildlog

or you can build the solution or open an existing log file through the viewer app:

Screenshot2

Logger supports three formats:

  1. *.binlog (official MSBuild binary log format)
  2. *.xml (for large human-readable XML logs)
  3. *.buildlog (compact binary logs, may run out of memory on very large builds)

Depending on which file extension you pass to the logger it will either write XML or binary. The viewer supports all formats and defaults to binary when saving. The binary log can be up to 200x smaller and faster.

Read more about the log formats here: https://github.com/KirillOsenkov/MSBuildStructuredLog/wiki/Log-Format

Features:

  • Displays double-writes (when files from different sources are written to the same destination during a build, thus causing non-determinism)
  • Displays target dependencies for each target
  • Text search through the entire log
  • Ctrl+C to copy an item and the entire subtree to Clipboard as text
  • Delete to hide nodes from the tree (to get uninteresting stuff out of the way)
  • Open and save log files (ask a friend to record and send you the log which you can then investigate on your machine)

Investigating problems with MSBuildStructuredLog

Open an issue if you're running into something weird and I can take a look into it. If MSBuildStructuredLog crashes during the build, it will attempt to write the exception call stack to:

%localappdata%\Microsoft\MSBuildStructuredLog\LoggerExceptions.txt

MSBuild Resources

About

A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%