Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910
View posts in large calendar

Say you wanted to create a report that included all commands users issue against the source code repository, based on its path in source control.  Such a reports might contain data like this:

Username

Source Control Folder

Start Time

Command

Darren

$/ScrumIsAwesome/

07/09/2009 19:38

Download

The first thing you would need to do is increase the verbosity of the logging being performed in Team Foundation Server; TFS inserts additional data into the TfsActivityLogging database if you go to the global web.config file (usually found in C:\program files\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\), and change the commandLogging option in the appSettings section to “All”, like this:

<appSettings>

<!-- WEB METHOD LOGGING
Specify web method logging behavior. The default value is 'None'.
Valid values and their meaning are:
None (Never log web methods)
OnError (Include web methods that encounter errors)
ReadWrite (Include web methods that change database(s))
Normal (Above, plus web methods that don't change database(s))
LightWeight (Above, plus web methods that have minimal database access)
All (Above, plus always include web method request details when avail.)
-->
<add key="commandLogging" value="All"/>

Then, restart the TFS Application Pool in IIS:

ScreenShot006

Then, run some source control operations (check in some files, get the latest version of files you don’t have already, etc…).

Finally, execute the following SQL query on the TfsActivityLogging database:

SELECT identityname "UserName"
,parametervalue "Source Control Root Folder"
, starttime "Start Time"
,Command
FROM tbl_command (nolock) c
LEFT JOIN tbl_parameter (nolock) p
ON c.commandid = p.commandid
WHERE p.parametervalue LIKE '$/%'

I tested this on Team Foundation Server 2008, Service Pack 1. The verbose logging may effect the performance of your server, so make sure you monitor it.