LINQ To Logs And Traces

| by Roopesh Shenoy Follow 0 Followers on Jan 09, 2014. Estimated reading time: 1 minute |

Microsoft Open Technologies recently announced the release of Tx, an open source project that can help debugging using Logs/Traces, and building of real-time monitoring and alerting systems.

Some interesting features –

  • Allows use of LINQ on raw event sources
  • Enables use of Reactive Extensions on real event sources with support for multiplexed event sequences (single sequence containing events of different types in order of occurence).
  • Possible to provide single query across multiple sources, with same API for both real-time and past history
  • On historical log/trace files, multiple queries can be performed in one read – for e.g. count all “Warning” events, match “Begin and “End” events and calculate average duration of each activity

You can either use LINQPad for one-off analysis or build .NET applications for building monitoring applications. In LINQPad, the experience of Tx is as if all the events were in a database. 

The release provides 4 different NuGet packages:

  • Tx.Core – common components not specific to a particular tracing format
  • Tx.Windows – Support for Event Tracing For Windows, Event logs, Performance counters from files and real-time counter API, IIS Text logs in W3C format
  • Tx.SqlServer – SQL Server extended events
  • Tx.All – A convenience package with all of the above

Note that Microsoft also advises when not to use Tx as well -

  • When there are no real-time feeds involved and data is already in memory or in a single file that is easy to parse, the guidance is to use LINQ-To-Objects instead of Tx.
  • When there are real-time feeds but each feed/file contains only a single type of events, use only Reactive Extensions

The tool has been in use internally at Microsoft in the WCF and Service Bus teams and is now open for all .NET developers to use for their own projects. You can have a look at the documentation to get started. 

Rate this Article

Adoption Stage

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Real time data ingestion and event analysis by Gaurav Pal

Roopesh -
Thanks for writing this post. There are a lot of emerging requirements for real-time monitoring and logging analytics of events. There is a whole set of solution options in the open source arena. The ability to collect and integrate events in real-time from Windows/Microsoft systems is a potential weak link in existing tools.

You might find the link below interesting.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Login to InfoQ to interact with what matters most to you.

Recover your password...


Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.


More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.


Stay up-to-date

Set up your notifications and don't miss out on content that matters to you