Serilog.Viewer 1.2.0

dotnet add package Serilog.Viewer --version 1.2.0
                    
NuGet\Install-Package Serilog.Viewer -Version 1.2.0
                    
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="Serilog.Viewer" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Serilog.Viewer" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Serilog.Viewer" />
                    
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 Serilog.Viewer --version 1.2.0
                    
#r "nuget: Serilog.Viewer, 1.2.0"
                    
#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 Serilog.Viewer@1.2.0
                    
#: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=Serilog.Viewer&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Serilog.Viewer&version=1.2.0
                    
Install as a Cake Tool

<div align="center"> <img src="src/Serilog.Viewer.React/src/log-viewer-icon.png" alt="Serilog.Viewer" width="120" /> <h1>Serilog.Viewer</h1> <p>A lightweight, embeddable log viewer for ASP.NET Core applications using Serilog structured logging.<br/>Browse, filter, and search log files through a modern React UI — served directly from your running application.</p>

NuGet Version NuGet Downloads License: MIT .NET </div>


Screenshots

Dashboard


Features

  • Dashboard — at-a-glance stats with charts for errors, warnings, and log volume over time
  • Log Explorer — paginated log browser with full-text search, level filtering, and date range selection
  • Live Tail — real-time streaming of new log entries via SignalR (optional add-on)
  • Multiple log formats — parses plain-text (.log/.txt) and CLEF compact JSON (.clef/.json)
  • Basic Authentication — optional username/password gate for the /logviewer route
  • Multi-framework — targets .NET 8 and .NET 9

Packages

Package NuGet Description
Serilog.Viewer NuGet Core middleware, log reading, and React UI
Serilog.Viewer.Realtime (coming soon) Optional SignalR extension for live log tailing

Getting Started

1. Install the NuGet package

dotnet add package Serilog.Viewer

2. Configure Serilog to write log files

Log.Logger = new LoggerConfiguration()
    .WriteTo.File(
        new CompactJsonFormatter(),
        "Logs/log-.clef",
        rollingInterval: RollingInterval.Day)
    .CreateLogger();

var builder = WebApplication.CreateBuilder(args);
builder.Host.UseSerilog();

3. Register services and map middleware

builder.Services.AddLogViewer(options =>
{
    options.LogFolder = "Logs";
});

var app = builder.Build();

app.UseLogViewer();
app.Run();

4. Open the viewer

Navigate to /logviewer in your browser.


Configuration

All options are set via the LogViewerOptions lambda passed to AddLogViewer:

Option Type Default Description
LogFolder string "Logs" Path to the folder containing Serilog log files
BasePath string "/logviewer" URL base path for the UI and API
EnableBasicAuth bool false Protect the viewer with HTTP Basic Authentication
Username string? null Username for Basic Auth (required when enabled)
Password string? null Password for Basic Auth (required when enabled)
AuthRealm string "Log Viewer" Realm shown in the browser's auth challenge dialog
EnableFileDownload bool true Allow downloading log files from the viewer UI and API
EnableFileDelete bool false Allow deleting log files from the viewer UI and API

Example — custom path and Basic Auth

builder.Services.AddLogViewer(options =>
{
    options.LogFolder = Path.Combine(AppContext.BaseDirectory, "Logs");
    options.BasePath = "/admin/logs";
    options.EnableBasicAuth = true;
    options.Username = "admin";
    options.Password = "s3cr3t";
});

Real-time Log Tailing

Install the optional SignalR add-on:

dotnet add package Serilog.Viewer.Realtime

Chain .AddLogViewerRealtime() onto the builder:

builder.Services.
    .AddLogViewer(options => { options.LogFolder = "Logs"; })
    .AddLogViewerRealtime();

A Live Tail tab will appear in the UI. No SignalR client code is required — the bundled React app handles it automatically. Applications that do not call AddLogViewerRealtime incur zero SignalR overhead.


Supported Log Formats

Extension Format Parser
.clef Compact Log Event Format (CLEF / JSON) ClefLogParser
.json Compact Log Event Format (CLEF / JSON) ClefLogParser
.log Plain-text Serilog output template PlainTextLogParser
.txt Plain-text Serilog output template PlainTextLogParser

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes following Conventional Commits: git commit -m "feat: add my feature"
  4. Push to your fork: git push origin feature/my-feature
  5. Open a Pull Request against main

Building locally

# Backend
dotnet build

# Frontend (inside src/Serilog.Viewer.React)
npm install
npm run build

Run the sample host to see the viewer in action:

dotnet run --project src/SampleHost
# then visit http://localhost:<port>/logviewer

License

MIT © Sreejith — see LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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. 
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
1.2.0 64 6/9/2026
1.1.0 74 6/7/2026
1.0.0 71 6/5/2026