NTrace is a library that provides flexible, high-performance, and zero-config trace logging for your C# applications.
NTrace is currently 100% C#.
What is NTrace?NTrace is a combination of a runtime framework and a code preprocessor that provides an API for using Event Tracing for Windows (ETW) in your managed code. In practice, it's a lot like the Windows Trace Preprocessor (WPP).
Why would I want to use NTrace?There are two high-level reasons why you'd want to use NTrace. The first is that it allows you to have trace instrumentation that can be enabled and disabled at runtime without having to modify any configuration files. The second is that the tracing capabilities provided by the ETW subsystem are very efficient and flexible. We've tried to preserve as much of the simplicity of using Trace.WriteLine while providing access to all of the features of WPP/ETW. The end result is that you have a great way to troubleshoot your code when it's out in the field.
RequirementsIn order to use NTrace, your code needs to meet the following criteria:
- You must be using the .NET 2.0 (or later) runtime
- You must be using Visual Studio 2008 or Visual Studio 2010
- Your code must be C# (VB support still eludes us due to differences in the NRefactory parsers)
At long last, NTrace 2.0 has been released! Many new features are included in this release:
- Native support for the .NET 4.0 framework
- Ability to modify the list of trace flags and levels, including Intellisense support for the new values
- Visual Studio 2008/2010 integration so that you may edit your provider ID, trace helper class name, and the lists of flags and levels offered by your ETW provider
- Better error reporting by the preprocessor, including file name, line and column information when available
- Various bugfixes found in the field
Good to see this project is still alive and breathing…. :)
Related Past Post XRef:
NTrace 1.0 (Beta) Released - Event Tracing for Windows (ETW) for C# Developers