Freigeben über


How to enable build agent or build controller’s logs?

Here are the steps which I typically perform to enable build agent/controller logs.

1. Go to the build agent/controller installation directory (typically it is something like C:\Program Files\Microsoft Team Foundation Server 2010\Tools).

2. Create a new configuration file named TFSBuildServiceHost.exe.config with the following content:

<configuration>
    <system.diagnostics>
        <switches>
            <add name="BuildServiceTraceLevel" value="4"/>
        </switches>
        <trace autoflush="true" indentsize="4">
            <listeners>
                <add name="myListener" type="Microsoft.TeamFoundation.TeamFoundationTextWriterTraceListener,Microsoft.TeamFoundation.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" initializeData="c:\logs\TFSBuildServiceHost.exe.log" />
         <remove name="Default" />
            </listeners>
        </trace>
    </system.diagnostics>
</configuration>

3. Create a new directory named c:\logs and ensure that the account under which the service Visual Studio Team Foundation Build Service Host has write permission on c:\logs.

4. Restart the build controller/agent service (net stop tfsbuildservicehost & net start tfsbuildservicehost).

After this a log file named TFSBuildServiceHost.exe.log should get generated in c:\logs directory.

Comments

  • Anonymous
    October 10, 2013
    Aseem, are these steps applicable to TFS 2012?

  • Anonymous
    October 10, 2013
    Yes, you just need to change the paths as well as version #s appropriately in the above instructions.RegardsAseem Bansal

  • Anonymous
    May 17, 2015
    What does Level 4 mean? Can you list the levels?

  • Anonymous
    May 18, 2015
    Turns out this was removed/changed in TFS 2012.  Doing the above does nothing in TFS 2012.  

  • Anonymous
    November 02, 2015
    yes it works, I just tried in TFS 2015 Its in $:Program FilesMicrosoft Team Foundation Server 2010Tools and not inside the build fodler