Here’s a list of how to enable logging for the various client and server components of VIsual Studio Team System:
TFS Client (Visual Studio IDE and command line tools):
devenv.exe.config (for Visual Studio IDE), tf.exe.config (for command line tools) as described in Ed Hintz on TFS Client Tracing. If you mainly want to measure performance the web service performance dialog can be added as a trave listener and is very helpful in that case.
Team Build Server
Look into the config file for instructions on how to enable tracing, typically found in: %ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\tfsbuildservice.exe.config.
Team Test Load Agent
You can turn on logging in the QTController.exe.config (for the Controller) and QTAgentService.exe.config (for the Agents). More information can be found here.
You might also be interested in other useful logging options for .NET.