Note that there are some explanatory texts on larger screens.

plurals
  1. POGranularity of Activity scope when tracing using system.diagnostics server side
    text
    copied!<p>I'm using the tracing functionality in System.Diagnostics, and have hit a problem of sorts. I've implemented tracing itself in my application with no issues, but am struggling with what some best practices would be. Or to put it more simply, I understand how, but not why.</p> <p>I have a RESTful client/server app, where the client is a web browser, and the server doesn't make any calls anywhere else (No WCF calls to other server processes for example).</p> <p>The concept I'm trying to get right is the concept of an Activity. Traces are conceptually grouped together, allowing you to see all traces messages for a particular Activity. During a single page load, I'll make a number of calls to various classes, to get data from the database, to perform business logic on the data, etc.</p> <p>How granular should an Activity be? The extremes of either 'a page load is a single Activity' or 'each method call is a new sub Activity'? Or is something in the middle, perhaps: 'the data access call, and the business logic call on page load are both sub Activities, and everything else comes under the main page load Activity'?</p> <p>The other concept is that of the <code>CorrelationManager.StartLogicalOperation</code> method. Again, the implementation of this isn't tricky, but understanding why to use it is. This seems to allow you to group a set of traces together under a logicalOperation name. There seems to be an overlap here with the concept of a trace Activity group however. Should these two concepts be used together? Why/In what situations would you use one over the other?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload