Core Package
TheSerilog package contains the core logging functionality:
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:File Sink
Write log events to text files with optional rolling:Other Popular Sinks
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:ASP.NET Core Application
For ASP.NET Core applications with enhanced integration:Cloud-Native Application
For applications running in containerized or cloud environments:Verifying Installation
After installing the packages, verify your installation by creating a simple logger: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: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