View, save, and configure build log files

After you build a project in the Visual Studio IDE, you can view information about that build in the Output window. By using this information, you can troubleshoot a build failure, view the exact command lines used for all the build tools, or get full diagnostic information about the entire build process.

  • For C++ projects, you can also view the same information in a log file that's created and saved when you build a project.

  • For .NET projects, you can click in the build output window and press Ctrl+S. Visual Studio prompts you for a location to save the information from the Output window into a log file.

You can also use the IDE to specify what kinds of information you want to view about each build.

If you build any kind of project by using MSBuild, you can create a log file to save information about the build. For more information, see Obtain build logs.

To view the build log file for a C++ project

  1. In Windows Explorer or File Explorer, open the following file (relative to the project root folder): Release\{ProjectName}.Log or Debug\{ProjectName}.log

To create a build log file for a managed-code project

  1. On the menu bar, choose Build > Build Solution.

  2. In the Output window, click somewhere in the text.

  3. Press Ctrl+S.

    Visual Studio prompts you for a location to save the build output.

You can also generate logs by running MSBuild directly from the command line, using the -fileLogger (-fl) command-line option. See Obtain build logs with MSBuild.

To change the amount of information included in the build log

  1. On the menu bar, choose Tools > Options.

  2. On the Projects and Solutions page, choose the Build and Run page.

  3. In the MSBuild project build output verbosity list, choose one of the values, and then choose the OK button.

The following table shows how the log verbosity (column values) affects which types of message (row values) are logged.

Message type / Verbosity Quiet Minimal Normal Detailed Diagnostic
Errors
Warnings
High-importance Messages
Normal-importance Messages
Low-importance Messages
Additional MSBuild-engine information

If you want to see the command lines used for the compiler and other tools, choose at least the Detailed verbosity level.

For more information, see Options dialog box, Projects and Solutions, Build and Run and LoggerVerbosity.

Important

You must rebuild the project for your changes to take effect in the Output window (all projects) and the <ProjectName>.txt file (C++ projects only).

Use binary logs to make it easier to browse large log files

Binary logs are an optional feature for .NET projects that lets you have a richer log browsing experience that might make it easier to find information in large logs. To use binary logs, install the Project System Tools. For more information, see https://msbuildlog.com and Binary Log.

Binary logs are an optional feature for .NET projects that lets you have a richer log browsing experience that might make it easier to find information in large logs. To use binary logs, install the Project System Tools 2022. For more information, see https://msbuildlog.com and Binary Log.