How to enable lab agent logs

Here are the steps which I typically perform to enable lab agent logs.

1. Go to the lab agent installation directory (typically it is something like C:\Program Files\Microsoft Visual Studio Lab Management 10.0).

2. Open the configuration file named LabAgentService.exe.config and edit it as shown below. (Changed autoflush from false to true, removed comments from the listeners section and changed the logging level from 2 to 4):

<trace autoflush="true" indentsize="4">
  <!--To enable tracing to file, simply uncomment listeners section and set trace switch(es) below.
      Directory specified for TextWriterTraceListener output must exist.—>
  <listeners>
<add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData=".\\labagent.log" />
<remove name="Default" />
</listeners>

</trace>

<switches>
  <!-- You must use integral values for "value".
       Use 0 for off, 1 for error, 2 for warn, 3 for info, and 4 for verbose. -->
  <add name="LabAgentTraceLevel" value ="4" />
</switches>   

3. Restart the lab agent service (net stop labagentservice & net start labagentservice).

After this a log file named labagent.log should get generated in the installation directory.