Introduction to Trace Sources with ReflectInsight Logging Extensions
August 21, 2013 1 Comment
We’ve updated our .NET Diagnostic Debug/Trace Extension to now include support for TraceSource.
The TraceSource class is used by applications to produce traces that can be associated with the application. TraceSource provides tracing methods that allow you to easily trace events, trace data, and issue informational traces. Trace output from TraceSource can be controlled by configuration file settings. The configuration file is located in the folder with the application executable and has the name of the application with the .config file name extension added. For example, the name of the configuration file for TraceSourceSample.exe is TraceSourceSample.exe.config. The configuration file can be used to determine where the trace information is to be sent and what levels of activity are to be traced.
To configure your application to use the new ReflectSoftware Insight Extension for TraceSource, you will need to add the the following to your app configuration file:
<configuration> <system.diagnostics> <sources> <source name="SourceTrace" switchValue="All"> <listeners> <clear /> <add name="ReflectInsight.Trace" /> </listeners> </source> </sources> <sharedListeners> <add name="ReflectInsight.Trace" type="ReflectSoftware.Insight.RITraceListener, ReflectSoftware.Insight" /> </sharedListeners> </system.diagnostics> </configuration>
New Message Types for TraceSource Messages
We’ve added additional message types to support TraceSource. These message types are Start, Stop, Suspend, Resume, Transfer and Verbose.
Here is a screenshot demonstrating these message types:
By adding support for TraceSource, this allows you to leverage your current investment in this, but leverage the power and flexibility that comes with the ReflectInsight viewer. You can now view your Debug/Trace messages in real-time, in a rich viewer that allows you to filter out and search for what really matters to you.
- Getting Started with ReflectInsight .NET Diagnostic Debug/Trace Extension
- TraceSource Class
- How to: Create and Initialize Trace Listeners
- How to: Use TraceSource and Filters with Trace Listeners