In this post, I want to talk about the steps which I typically perform to enable the job agent logs for lab operations.
1. Stop the TFS job agent service. (net stop tfsjobagent)
2. Enable tracing for Tfs job agent.
<system.diagnostics>
<trace autoflush="false" indentsize="4">
<listeners>
<add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\Temp\jobagent.log" />
<remove name="Default" />
</listeners>
</trace>
<switches>
<add name="API" value="0" />
<add name="Authentication" value="0" />
<add name="Authorization" value="0" />
<add name="Database" value="4" />
<add name="General" value="4" />
<add name="traceLevel" value="0" />
</switches>
</system.diagnostics>
3. Start the TFS job agent (net start tfsjobagent)
After these steps the job agent logs are visible in the configured file (c:\temp\jobagent.log).