How to enable test agent logs


Here are the steps which you should perform to enable test agent logs.

1. Go to your test agent installation directory (typically it is something like C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\).

2. Open the agent service configuration file (QTAgentService.exe.config) and change the trace level to 4 and enable the trace listener as shown below:

  <system.diagnostics>
    <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=”EqtTraceLevel” value=”4″ />
    </switches>
  </system.diagnostics> 

…..

    <add key=”CreateTraceListener” value=”yes”/>
  </appSettings>
</configuration>

3. Do step 2 for agent execution processes (QTAgent.exe.config, QTAgent32.exe.config) and agent collection processes (QTDCAgent.exe.config and QTDCAgent32.exe.config).

4. Restart the test agent (service or process).

After this the log files named (VSTTagent.log, VSTTAgentProcess.log, VSTTDCAgentProcess.log) should get generated in the installation directory itself.

Note: – If the test agent is running under a user account and not under system account (like Network Service), then you can use another mechanism (which is much simpler) to enable/disable logging. In this mechanism, you will set a couple of registry keys which will update the log level for all the processes and there is no need to edit configuration file for each process. More details on these registry keys (files) are mentioned in Gautam’s blog here but please note that these registry settings are under HKCU (Current user) so before you apply the registry settings mentioned on Gautam’s blog, you should be logged in to the machine as the user under which the test agent is running.  Using this mechanism the log files are generated in the %temp% directory of the user. 

Posted Saturday, November 28, 2009 8:02 AM by aseemb | 0 Comments

Comments (6)

  1. vamsi k says:

    Hi,

    I Have modified the files as mentioned but i can only see 2 log files named "VSTTAgent.log" and "VSTTDCAgentProcess.log".

    And also i am executing a automated unittest that modifies some of the database fields and the database machine is a different machine.

    I am getting the following error in MTM as a result of the automated unit test execution.

    Can you please help me resolving this issue.

    And also can you please tell me the location  where i can see the error details ?

    I couldn't  find the error message in any of the 2 log files mentioned above.

    please help me to resolve this.

    Thanks in advance,

    Regards,

    vamsi k

  2. aseemb says:

    Vamsi, What is the error message that you are getting? There might be other QTAgent*.exe.config file like QTAgent32_40.exe.config and you might have to enable the logs in them to get the error message?

    Regards

    Aseem Bansal

  3. Bheema says:

    Hi,

    i am unable to change the QTAgent32 config file as am getting an error – Access denied while saving the file even i opened the file with admin. Can you please help on this.

    -Thanks,

    Bheema.

  4. Engy says:

    Hi Bheema…

    YOu need to open notepad.exe as an admin and then open the file from there… then u can save

  5. Alok Kumar says:

    Hi Aseem..searched the internet but did not get detailed information about :

    a. the various QTAgent*.exe s .What is the significance of each and when are they invoked

    b. what are the VS***.logs generated corresponding to each QTAgent and the information they log

  6. AlokKr says:

    Hi Aseem..searched the internet but did not get detailed information about :

    a. the various QTAgent*.exe s .What is the significance of each and when are they invoked

    b. what are the VS***.logs generated corresponding to each QTAgent and the information they log