Logly 3.0.1

dotnet add package Logly --version 3.0.1
                    
NuGet\Install-Package Logly -Version 3.0.1
                    
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="Logly" Version="3.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Logly" Version="3.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Logly" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Logly --version 3.0.1
                    
#r "nuget: Logly, 3.0.1"
                    
#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.
#:package Logly@3.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Logly&version=3.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Logly&version=3.0.1
                    
Install as a Cake Tool

Logly

Build, Test & Coverage License: MIT NuGet Version

Logly is an ASP.NET Core middleware library for structured HTTP request and response logging. It is inspired by morgan for Node.js and gives you control over exactly what gets logged, with minimal setup.

Example Output

logly screenshot

Installation

Install via the NuGet package manager:

dotnet add package Logly

Or via the Package Manager Console:

Install-Package Logly

Supported Frameworks

  • .NET Core 3.1
  • .NET 5, 6, 7, 8, 9, 10

Prerequisites

To avoid duplicate log output, clear the default ASP.NET Core logging providers when building your host:

public static IWebHost BuildWebHost(string[] args) =>
    WebHost.CreateDefaultBuilder(args)
        .ConfigureLogging((context, logging) =>
        {
            logging.ClearProviders();
        })
        .UseStartup<Startup>()
        .Build();

Setup

Simple Setup

Add a single line to your middleware pipeline in Program.cs or Startup.cs:

app.UseLogly();

This logs the following by default:

  • HTTP method (GET, POST, etc.)
  • Request URL
  • Response status code

Custom Setup

Use LoggerOptionsBuilder to choose exactly what gets logged:

app.UseLogly(opts => opts
    .AddRequestMethod()   // HTTP method (GET, POST, etc.)
    .AddUrl()             // Request URL
    .AddStatusCode()      // Response status code
    .AddResponseTime()    // Time taken to process the request (ms)
    .AddResponseLength()  // Response body size (bytes)
);

Ignoring URLs

Use IgnoreUrls to exclude specific paths from logging. This is useful for health checks, metrics endpoints, or any route you do not want to appear in logs.

app.UseLogly(opts => opts
    .AddRequestMethod()
    .AddStatusCode()
    .IgnoreUrls("/health", "/metrics", "/swagger/*")
);

Glob patterns are supported, so /swagger/* will match all routes under /swagger/.

Credits

This library was originally based on work by Casey MacPherson.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.1 85 5/18/2026
3.0.0 307 2/7/2025
2.0.0 2,932 8/5/2020
1.0.2 2,261 2/27/2019
1.0.1 1,357 1/3/2019
1.0.0 1,755 7/2/2018

- update dependencies
           - add newer .NET version support
           - remove older targets like ASP.NET 1 and 2