Fast and comprehensive logging tool for .NET applications. Designed for high-performance, storage-efficient, always-on logging and comes with a useful log viewer application.
Please bring about 8 minutes to read this page in peace.
tl;dr: Overview of the advantages and features:
FieldLog is a fast and comprehensive logging tool for .NET applications. It allows applications to write events, data and errors to managed and efficient log files. The logging methods are optimised for high performance multi-threaded operation and a single log method call takes as little as half a microsecond on modern hardware. There’s no comparison to OutputDebugString, Debug.WriteLine or appending to a file each time! This logging can be used in performance-critical loops without noticeably slowing down the application.
The general idea is to always leave debug logging enabled to be able to analyse it in case of an application failure. Traditional log systems can only append to log files but never delete old data. This leads to constantly increasing log size with the debug level enabled. FieldLog can manage its log files and only keep items of each priority for a specific time, then delete it to save space and remove unnecessary data. The low latency and good storage efficiency allow you to keep logging enabled. When an error occurs, all the relevant information is already here to be analysed.
You don’t need to instruct your users to enable logging by tinkering with hidden XML files and wait for the error to happen again. Instead, the user is guided through collecting the relevant logs and submitting them directly to the developer.
The log items are written in a binary format that minimises the amount of bytes per information and reuses any previous text strings for storage efficiency. If the same message string is logged over and over again, it will hardly increase the log size. The files are separated by log priority and a new file is started after a certain file size or time. If available, NTFS compression is used and considered in file size decisions. Old log items are automatically deleted. The maximum log size and keep time is configurable by an easy to understand and robust text file in the application directory.
The log viewer application, FieldLogViewer, loads a set of related log files and displays the log items in a list. The user can select any item to view all the details like thread ID, additional exception data, stack traces or system environment data at that time. Items are colour-coded by their priority and icons display the type of event.
A powerful filter editor allows you to quickly find the interesting events and concentrate on what matters. The viewer can even keep reading at the end of the log files and show new log items as they are written by the running application. This allows a developer to monitor the application in real-time. The selected filter remains in effect.
You can also use FieldLogViewer as a DebugOutputString listener (like Sysinternals’ DbgView) and read limited debug output from other processes as well.
An easy to use log sumit tool guides the user through the process of selecting the relevant log files and screenshots, packaging them for transport and choosing a suitable transport method. The transport methods are currently HTTP webservice upload, sending an e-mail and copying the package to a local directory like a USB flash drive. Future methods are using an FTP server and sending to Bluetooth devices. This tool can be started in response to an unhandled or unrecoverable application error (crash reporting) so that the user is prompted with the right information and can submit trace logs while they’re fresh.
The following C# example shows several usage possibilities of FieldLog.
static void Main(string args)
// Indicate that we're not waiting for a custom log path to be configured.
// If one is provided by the Program.flconfig file, it will be used first.
// Otherwise, the default path strategy is applied.
// Write out a first trace message that tells what's about to happen in the
// Do the actual initialisation for the application
catch (IOException ex)
// An Error event means that something has severely failed but the
// situation could be handled.
FL.Error(ex, "App initialisation");
// A Critical event is when the application cannot continue to work.
FL.Critical("Application was not initialised");
// A Checkpoint is a more important Trace message.
// Another way to log messages
FL.Text(FieldLogPriority.Notice, "A notice message");
// Main application logic here...
// Measure how long a function takes, averaging multiple iterations
foreach (var record in GetRecords())
using (FL.Timer("Long operation"))
// Some bonus features:
// Information about the application (reading assembly attributes)
Console.WriteLine("I am " + FL.AppName + " version " + FL.AppVersion);
// Current time using high-precision timer
Console.WriteLine("Now it's precisely " + FL.UtcNow + " (UTC)");
// App uptime using high-precision timer
Console.WriteLine("App is running for " + FL.AppUptime);
// System information: Windows version and edition
Console.WriteLine(OSInfo.Version + " " + OSInfo.Edition);
// System information: Windows installed language
// System information: User is administrator (does not show UAC dialog)
// Write something to the system settings
static void SectionA()
// Log the scope of this method. The method name is set automatically.
// Do interesting stuff here.
int count = 23;
static void SectionB(int count)
// Log the scope of this method. The method name is set automatically.
// Log the variable name and value with Trace priority.
static void LongOperation()
You can also take a look at and play with the ConsoleDemo application included in the source code to learn about the logging API.
Here are several screenshots of the FieldLogViewer application:
Note: Releases after 2016-01-09 are no longer digitally signed because there are no more free code signing certificates available for open source developers. A commercial certificate from 100 € per year doesn’t pay for me. I’m sorry for the confusion this may cause with your next download.Previous versions
You can also head over to GitHub to download any previous revision or check the issue tracker:
This package is also available through NuGet. That way, it can be integrated and updated in a Visual Studio project very quickly. This package only includes the FieldLog assembly for all .NET versions. For installing FieldLogViewer you need to download the setup program above.
Current development state
FieldLog and the log file format are stable but could use some more testing. There are plans for future additional features that may change the API and file format. The file format is versioned so it is possible to continue reading old files, even in the same log file set.
FieldLogViewer is pretty stable by now. There are still lots of features and improvements planned and this is where the most changes happen now. See the Git change log for details.
The log submit tool is usable but still new and does not support all planned transport methods yet. If you need to translate it to more languages, please send me the dictionary file so I can include it. You can also keep it to yourself and use a private build.
The documentation is currently limited to the FieldLog code documentation and the developer guide page (German only). The source code reference is not ready for the public yet, use the inline comments through IntelliSense instead (original source code or .xml file as included in the NuGet package).
- FieldLog: Don't log WPF "Cannot find governing FrameworkElement" messages
- FieldLog: High-resolution system time using the GetSystemTimePreciseAsFileTime method (Windows 8 or later)
- FieldLog: README file in the log directory explains that all files are necessary when copying
- FieldLogViewer: Improved 200% high DPI image scaling (like Visual Studio once did)
- FieldLogViewer: Added Windows 10 theme (incomplete) besides Windows 8 theme
- FieldLogViewer: Make use of WPF 4.6 high-DPI layout improvements (App.config)
- FieldLogViewer: Fixed: Prevent windows stuck invisible on now disconnected monitors
- LogSubmit: Finds log files directly in the current directory
- LogSubmit: Validates e-mail address if provided
- LogSubmit: Saves last entered user e-mail address for the next report
- FieldLog: Simplified exception message formatting (without namespace, not for obfuscated names)
- AppErrorDialog: Increased height for localised titles
- AppErrorDialog supports High DPI screens
- Entity Framework: EntityValidationErrors logging support
- FieldLogViewer: Fixed problems around filter exceptions
- FieldLogViewer: Fixed display of underscores in menu with recently loaded files
- Don't log time recalibration if there was no log item recently
- Fixed: Dynamic methods have no metadata token, so FieldLogStackFrame can't retrieve it
- FieldLogViewer: Little UI enhancements (added details indicator, new enter/leave images)
- Fixed exception logging (and source resolving, deobfuscation) with dynamic or unknown modules and global functions
- Fixed AppErrorDialog message showing horizontal scrollbar when not necessary
- FieldLogViewer: Fixed loading of compressed obfuscation map file
- FieldLogViewer: Optional separator line between log items that represents the time passed between two items
- FieldLogViewer: Limited MRU items list to 15 log base paths
- FieldLogViewer: Do not add temporary log files to the MRU list
- Ignore more WPF trace messages about CanFreeze. These are a WPF bug and not interesting at all.
- Shared code and build script update
- Add new .mapz extension for compressed obfuscation map files
- Improved PdbConvert /optimize performance through parallelisation
- Fixed NullReferenceException when creating a screenshot for no window
- FieldLogViewer: Improved error handling for stack frame module names
- Don't write log files until something relevant happens
- Never try to write log files to a protected service account directory
- Updated build script for Git for Windows 2.x
- Obfuscation compatibility
- FieldLogViewer: Fixed unhandled ArgumentException at Path.GetFileNameWithoutExtension
- FieldLog: Added TextRetainedAppend method
What’s yet to come…
This is an unsorted list of things that are on my to-do list. There is no time schedule but I intend to implement all of these as soon as I have the time for it.
The name “FieldLog” was originally supposed to refer to “out in the field logging” which is where your applications run. It does everything it can to maintain itself out there and to provide the developer with all relevant information about any problems that might occur. The developer does not need to go where the application runs if users have sufficient internet connectivity or remote hands to submit logs and install updates.
Another interpretation might refer to the structured log items that distinguishes FieldLog from plain text log files that actually only store a single line of raw text about each event. Being able to access and understand each bit of information allows for filtering the data masses to actually see the interesting parts.
The logo merges the capital letters F and L into a combined shape (which happens to look like an E), using different colours for the parts distinct from both letters and the shared part. The horizontal bars also depict “good” and “error” rows in a log list, which is basically what you can see with FieldLog.
The FieldLog library, which is used in applications, is released under the terms of the GNU LGPL licence, version 3. The other projects (FieldLogViewer, demos and tools) are released under the terms of the GNU GPL licence, version 3. You can find the detailed terms and conditions in the download or on the GNU website (LGPL, GPL).
- Created on 2013-06-30, updated on 2017-02-14.
- Ca. 27 000 lines of code, estimated development costs: 27 000 - 110 000 €