This project has moved. For the latest updates, please go here.

Debugging

To assist in debugging the administrator can

  • Enable logging in the web.config: using the LogEventsToFile settings. If this is set on, then an XML file will be dropped in the  specified logging folder.
    REMEMBER if you enable this feature files will be created in the dump folder which you will need to manually delete.
  • If the service is not called, use the diagnostic suggestions in the references section of this document to look for subscription errors in the TFS SQL tables. But check first the URL is correct, it is easy to make a typo.
  • All other debugging is handled via nLog, so the options are varied. Probably the best debugging options are
    • view the Debug Trace output. You can attach a Visual Studio debugger; but the best way to do this on a production environment is run the SysInternals DebugView (note that this needs to be ‘run as administrator’ to see all log information for all processes).
    • sends errors to the Windows event log (see https://tfsalertsdsl.codeplex.com/releases/view/126004)
    • sends logging to a file

The following nLog.config file provides examples of logging options. Any nLog targets can be used as needed

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns=http://www.nlog-project.org/schemas/NLog.xsd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- See http://nlog-project.org/wiki/Configuration_file for information on customizing logging rules and outputs.—>
<targets>
<!-- add your targets here –>
<!--<target xsi:type="File" name="f" fileName="${basedir}app_data\logs\${shortdate}.log" layout="${longdate} ${uppercase:${level}} ${message}" />—>
<target xsi:type="OutputDebugString" name="d" layout="${longdate} ${uppercase:${level}} ${message}" />
<!-- Need to make sure the source is created, this can be via an MSI or command line tool http://msdn.microsoft.com/en-us/library/2awhba7a.aspx –>
<target xsi:type="EventLog"name="e" layout="${longdate} ${uppercase:${level}} ${message}" source="TfsAlertProcessor" eventId="1" log="Application" />
</targets>
<rules> <!-- add your logging rules here –>
<logger name="*" minlevel="Trace" writeTo="d" />
<logger name="*" minlevel="Error" writeTo="e" />
<!--<logger name="*" minlevel="Trace" writeTo="f" />—>
</rules>
</nlog>
Note that for logging to the event log to work, the event source must be manually created. A tool to do this is provided on this site as the download https://tfsalertsdsl.codeplex.com/releases/view/126004 . More details on creating event sources can be found on MSDN at http://msdn.microsoft.com/en-us/library/2awhba7a.aspx

Last edited Aug 3, 2014 at 11:32 PM by rfennell, version 10