Skip to main content
Serilog is distributed as a NuGet package. You’ll need the core Serilog package plus at least one sink package to output your logs.

Core Package

The Serilog package contains the core logging functionality:
dotnet add package Serilog

Installing Sinks

Serilog requires at least one sink to output log events. Here are the most commonly used sinks:

Console Sink

Write log events to the console with color-coded output:
dotnet add package Serilog.Sinks.Console

File Sink

Write log events to text files with optional rolling:
dotnet add package Serilog.Sinks.File
dotnet add package Serilog.Sinks.Seq
Over 200 sinks are available for various destinations including databases, cloud services, message queues, and monitoring platforms. Browse the full list at serilog.net.

Quick Install for Common Scenarios

Console Application

For a basic console application with console and file output:
dotnet add package Serilog
dotnet add package Serilog.Sinks.Console
dotnet add package Serilog.Sinks.File

ASP.NET Core Application

For ASP.NET Core applications with enhanced integration:
dotnet add package Serilog
dotnet add package Serilog.AspNetCore
dotnet add package Serilog.Sinks.Console
dotnet add package Serilog.Sinks.File

Cloud-Native Application

For applications running in containerized or cloud environments:
dotnet add package Serilog
dotnet add package Serilog.Sinks.Console
dotnet add package Serilog.Formatting.Compact
dotnet add package Serilog.Enrichers.Environment

Verifying Installation

After installing the packages, verify your installation by creating a simple logger:
using Serilog;

// Create a simple logger
var log = new LoggerConfiguration()
    .WriteTo.Console()
    .CreateLogger();

log.Information("Serilog is installed and working!");
log.Dispose();
Run your application, and you should see the log message in your console output.

Package Compatibility

Serilog packages target multiple frameworks for broad compatibility:
Package.NET 6+.NET Standard 2.0.NET Framework 4.6.2+
Serilog
Serilog.Sinks.Console
Serilog.Sinks.File
Serilog 4.x+ is AOT (Ahead-of-Time) compatible for .NET 7.0 and later, making it suitable for use with Native AOT compilation.

Configuration Packages (Optional)

If you prefer configuration-based setup over code-based configuration:
dotnet add package Serilog.Settings.Configuration

Next Steps

Now that Serilog is installed, learn how to configure and use it:

Quick Start

Configure your first logger and start logging in minutes

Build docs developers (and LLMs) love