Spiffy.Monitoring 6.2.3

.NET Standard 2.0
dotnet add package Spiffy.Monitoring --version 6.2.3
NuGet\Install-Package Spiffy.Monitoring -Version 6.2.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Spiffy.Monitoring" Version="6.2.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Spiffy.Monitoring --version 6.2.3
#r "nuget: Spiffy.Monitoring, 6.2.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Spiffy.Monitoring as a Cake Addin
#addin nuget:?package=Spiffy.Monitoring&version=6.2.3

// Install Spiffy.Monitoring as a Cake Tool
#tool nuget:?package=Spiffy.Monitoring&version=6.2.3


A structured logging framework for .NET that supports log aggregation, e.g. Splunk.

Handled over 919,000,000,000 production requests (and counting!)



Package Latest Release
Spiffy.Monitoring NuGet version
Spiffy.Monitoring.Aws NuGet version
Spiffy.Monitoring.NLog NuGet version
Spiffy.Monitoring.Prometheus NuGet version
Spiffy.Monitoring.Splunk NuGet version


PM> Install-Package Spiffy.Monitoring

Built-In Logging Providers

Spiffy.Monitoring includes "built-in" logging mechanisms (Trace and Console).

There is no default logging behavior, you must initialize provider(s) by calling Spiffy.Monitoring.Configuration.Initialize.

Until initialized, any published EventContext will not be observable, so it is recommended that initialization be as early as possible when your application is starting (i.e. in the entry point).


  Configuration.Initialize(spiffy => { spiffy.Providers.Console(); });

Extended Providers

For extended functionality, you'll need to install a "provider package".

NOTE: the provider package need only be installed for your application's entry point assembly, it need not be installed in library packages.

NLog Provider

PM> Install-Package Spiffy.Monitoring.NLog


    static void Main() {
        // this should be the first line of your application
        Spiffy.Monitoring.Configuration.Initialize(spiffy => {
                .NLog(nlog => nlog.Targets(t => t.File()));

Multiple Providers

Multiple providers can be provied, for example, this application uses both Console (built-in), as well as File (NLog)


    Spiffy.Monitoring.Configuration.Initialize(spiffy => {
            .NLog(nlog => nlog.Targets(t => t.File()));


Example Program

        // key-value-pairs set here appear in every event message
            .Set("Application", "MyApplication");

        using (var context = new EventContext()) {
            context["Key"] = "Value";

            using (context.Time("LongRunning")) {

            try {
            catch (Exception ex) {

Normal Entry

[2014-06-13 00:05:17.634Z] Application=MyApplication Level=Info Component=Program Operation=Main TimeElapsed=1004.2 Key=Value TimeElapsed_LongRunning=1000.2

Exception Entry

[2014-06-13 00:12:52.038Z] Application=MyApplication Level=Error Component=Program Operation=Main TimeElapsed=1027.0 Key=Value ErrorReason="An exception has ocurred" Exception_Type=ApplicationException Exception_Message="you were unlucky!" Exception_StackTrace=" at TestConsoleApp.Program.DoSomethingDangerous() in c:\src\git\github\chris-peterson\Spiffy\src\Tests\TestConsoleApp\Program.cs:line 47 at TestConsoleApp.Program.Main() in c:\src\git\github\chris-peterson\Spiffy\src\Tests\TestConsoleApp\Program.cs:line 29" InnermostException_Type=NullReferenceException InnermostException_Message="Object reference not set to an instance of an object." InnermostException_StackTrace={null} Exception="See Exception_* and InnermostException_* for more details" TimeElapsed_LongRunning=1000.0

Hosting Frameworks

Spiffy.Monitoring is designed to be easy to use in any context.

The most basic usage is to instrument a specific method. This can be achieved by "newing up" an EventContext. This usage mode results in Component being set to the containing code's class name, and Operation is set to the containing code's method name

There are times when you may want to instrument something that's not a specific method. One such example is an API -- in this context, you might want to have 1 log event per request. Consider setting Component to be the controller name, and Operation the action name. To acheive this, add middleware that calls EventContext.Initialize with the desired labels.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on Spiffy.Monitoring:

Package Downloads

A library for consuming consul values in a continuous stream using the Reactive Extensions


The NLog adapter for Spiffy.Monitoring


The Prometheus provider for Spiffy.Monitoring


A library to boost confidence when making code changes


The Splunk provider for Spiffy.Monitoring

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.2.3 369 1/18/2023
6.2.2 239 1/6/2023
6.2.1 152 1/6/2023
6.2.0 446 5/2/2022
6.2.0-alpha 111 5/2/2022
6.1.0 2,329 11/2/2021
6.0.8 1,448 8/9/2021
6.0.7 539 6/15/2021
6.0.6 605 11/12/2020
6.0.5 402 11/10/2020
6.0.3 509 10/30/2020
5.2.0 824 10/18/2019
5.1.2 5,642 11/12/2018
5.1.1 2,306 10/19/2018
5.1.0 10,815 1/15/2018
5.0.0 1,292 10/25/2017
4.0.5 8,982 7/5/2017
4.0.4 1,071 6/25/2017
4.0.3 1,137 6/20/2017
4.0.2 1,650 5/23/2017
4.0.1 1,811 4/16/2017
3.1.0 1,980 1/26/2017
3.0.0 3,857 7/27/2016
2.0.1 1,311 6/17/2015
2.0.0 1,755 4/30/2015
1.2.0 1,439 4/6/2015
1.1.0 1,416 3/17/2015
1.0.0 1,585 6/12/2014

Bugfix for out-of-range exception if all quote types exist in a value (https://github.com/chris-peterson/spiffy/pull/35)