.NET namespaces you had long since forgotten: System.IO.Log
Posted: (EET/GMT+2)
Today, I wanted to highlight one part of the vast .NET framework class library that you might not wander often: the System.IO.Log namespace.
On MSDN, this namespace is described like this: "The System.IO.Log namespace defines an interface for logging to a record-oriented sequential I/O system.". Yes, that's true, but does actually tell very little. But it helps to learn that the System.IO.Log namespace is actually a wrapper around a native Win32 API called the Common Log File System (CLFS) API.
The CLFS dates back to Windows Vista (remember?), and Vista actually brought forward many interesting, even though lesser-known features, including CLFS, and one of my personal favorites, the Transactional NTFS.
Now, CLFS (and thus, System.IO.Log) is a common set of functionality for generic logging needs for both single applications and set of applications working together on a single log file. A log file is completely developer-defined, and has no pre-defined file format. All this is done in code.
You might think CLFS is just something that's too complex compared to a simple text file, but the CLFS supports things like log growth management, archiving, single-writer and multiple-reader scenarios, and more.
In case you need a more sophisticated logging than just simple text files, check out this C# compatible API implemented in the System.IO.Log namespace.