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:

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

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 (5)

  1. B says:

    Aseem, are these steps applicable to TFS 2012?

  2. Yes, you just need to change the paths as well as version #s appropriately in the above instructions.


    Aseem Bansal

  3. Greg_at_eSolar says:

    What does Level 4 mean?

    Can you list the levels?

  4. Greg_at_eSolar says:

    Turns out this was removed/changed in TFS 2012.  Doing the above does nothing in TFS 2012.  

  5. Sundar says:

    yes it works, I just tried in TFS 2015

    Its in $:Program FilesMicrosoft Team Foundation Server 2010Tools and not inside the build fodler