PostSharp Diagnostics

The no-brainer instrumentation toolbox for .NET and .NET Core.

Add extensive logging to your application in minutes and direct it to any logging framework.
Your way, faster than hand-written code.

Key Features

  • Super easy. You'll be done in minutes.
  • Super detailed. See parameter values, timing, and more.
  • Super fast. Faster than hand-written code.
  • Super customizable. Override every single moving part.
  • Works with your existing logging framework.

// Add logging to a whole namespace in just one line.
[assembly: Log(AttributePriority = 1, 
               AttributeTargetTypes = "BusinessLayer.*")]
                    
[Log(AttributeExclude = true)]
class Program
{
    static void Main(string[] args)
    {
        // Configure logging at run time.
        var backend = new ConsoleLoggingBackend();
        backend.Options.Delimiter = " \u00A6 ";
        LoggingServices.DefaultBackend = backend ;
                    
        // Details skipped.
    }
}

Super Fast

Zero Logging = Zero Cost – If logging is disabled for a given namespace during application start-up, the cost overhead is strictly zero.

Enable/disable at run time – Logging can be turned on and off dynamically at run time using a simple API.

Minimal memory allocation – PostSharp Logging does not allocate memory until the very last moment.

Performance warnings – Set up a warning when the method execution time exceeds a given threshold.

Super Detailed

You can choose to include the following pieces of data into your logs:

  • Full method and type name
  • Parameter name, type and value
  • this value
  • Execution time
  • Async state machine id
  • Field changes
  • Works on any method

Supported Frameworks

PostSharp provides out-of-the-box integration with the following products:

  • Log4Net
  • NLog
  • Common.Logging
  • Serilog
  • EventSource (ETW)
  • System.Diagnostics
  • Console.WriteLine
  • Microsoft.Extensions.Logging (.NET Core)
  • Enterprise Library
  • Application Insights
  • Loupe
  • Any other framework (custom back-end)
Break free from routine TODAY and start delivering more in less time. download
10% of Fortune 500 companies have already made the choice.