Serilog.Sinks.RichTextBox.WinForms.Colored
2.0.0
See the version list below for details.
Requires NuGet 3.3 or higher.
dotnet add package Serilog.Sinks.RichTextBox.WinForms.Colored --version 2.0.0
NuGet\Install-Package Serilog.Sinks.RichTextBox.WinForms.Colored -Version 2.0.0
<PackageReference Include="Serilog.Sinks.RichTextBox.WinForms.Colored" Version="2.0.0" />
<PackageVersion Include="Serilog.Sinks.RichTextBox.WinForms.Colored" Version="2.0.0" />
<PackageReference Include="Serilog.Sinks.RichTextBox.WinForms.Colored" />
paket add Serilog.Sinks.RichTextBox.WinForms.Colored --version 2.0.0
#r "nuget: Serilog.Sinks.RichTextBox.WinForms.Colored, 2.0.0"
#:package Serilog.Sinks.RichTextBox.WinForms.Colored@2.0.0
#addin nuget:?package=Serilog.Sinks.RichTextBox.WinForms.Colored&version=2.0.0
#tool nuget:?package=Serilog.Sinks.RichTextBox.WinForms.Colored&version=2.0.0
Serilog.Sinks.RichTextBox.WinForms.Colored
A Serilog sink that writes log events to a WinForms RichTextBox with support for coloring and custom themes.

Features
- Write log events to a WinForms RichTextBox control
- Customizable themes (Dark and Light presets available)
- Configurable output templates
- Auto-scrolling option
- Line limit control
Installation
Install the package from NuGet:
Install-Package Serilog.Sinks.RichTextBox.WinForms.Colored
Usage
Basic Setup
Declare your RichTextBox control:
private System.Windows.Forms.RichTextBox richTextBox1;
private void InitializeComponent()
{
this.richTextBox1.BackColor = System.Drawing.SystemColors.Window;
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Font = new System.Drawing.Font("Consolas", 10.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.richTextBox1.Location = new System.Drawing.Point(0, 0);
this.richTextBox1.Name = "richTextBox1";
}
Configure the logger:
Log.Logger = new LoggerConfiguration()
.WriteTo.RichTextBox(richTextBox1)
.CreateLogger();
Log.Information("Hello, world!");
Advanced Configuration
You can customize the sink using various parameters from the RichTextBox extension method:
Log.Logger = new LoggerConfiguration()
.WriteTo.RichTextBox(
richTextBoxControl: richTextBox1,
minimumLogEventLevel: LogEventLevel.Debug,
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}",
theme: ThemePresets.Light,
messageBatchSize: 100,
messagePendingInterval: 10,
autoScroll: true,
maxLogLines: 1000)
.CreateLogger();
Themes
Available built-in themes:
| Theme | Description |
|---|---|
ThemePresets.Dark |
Similar to the default theme of Serilog.Sinks.Console |
ThemePresets.Light |
Light background with contrasting colors |
Support and Contribute
If you find value in this project, there are several ways you can contribute:
- Become a Sponsor: Support the project through GitHub Sponsors.
- Show Your Appreciation: Give the project a star on GitHub.
- Contribute: Improve documentation, report bugs, or submit pull requests.
License
This project is licensed under the Apache License, Version 2.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net8.0-windows was computed. net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
| .NET Framework | net452 is compatible. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Serilog.Sinks.RichTextBox.WinForms.Colored:
| Package | Downloads |
|---|---|
|
Bciflex.Brainstorm.Common
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.2.0 | 646 | 11/10/2025 |
| 3.1.3 | 7,239 | 7/13/2025 |
| 3.1.2 | 305 | 7/7/2025 |
| 3.1.1 | 232 | 7/3/2025 |
| 3.1.0 | 221 | 6/30/2025 |
| 3.0.1 | 194 | 6/28/2025 |
| 3.0.0 | 246 | 6/21/2025 |
| 2.1.2 | 327 | 6/6/2025 |
| 2.1.0 | 3,459 | 3/17/2025 |
| 2.0.0 | 9,337 | 9/8/2024 |
| 1.2.2 | 5,422 | 4/15/2024 |
| 1.2.1 | 1,280 | 3/30/2024 |
| 1.2.0 | 5,078 | 9/25/2023 |
| 1.1.2 | 11,225 | 10/16/2022 |
| 1.1.1 | 975 | 9/9/2022 |
| 1.1.0 | 1,344 | 6/24/2022 |
| 1.0.2 | 1,010 | 6/11/2022 |
| 1.0.1 | 1,026 | 5/16/2022 |
| 1.0.0 | 1,034 | 5/9/2022 |
- Added support for .NET 8
- Added support for .NET Framework 4.5.2
- Added outputTemplate and formatProvider to options
See repository for more information:
https://github.com/vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored