{"id":21866427,"url":"https://github.com/vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored","last_synced_at":"2025-07-21T03:31:12.061Z","repository":{"id":144386589,"uuid":"490279057","full_name":"vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored","owner":"vonhoff","description":"A Serilog sink that writes log events to a WinForms RichTextBox control with colors and theme support","archived":false,"fork":false,"pushed_at":"2025-07-13T07:47:24.000Z","size":514,"stargazers_count":24,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-19T05:41:39.219Z","etag":null,"topics":["colored","colored-log","colored-logging","console","forms","high-contrast","logger","logging","rich-text","richtextbox","serilog","serilog-sink","sink","sinks","themes","windows-forms","winforms"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/Serilog.Sinks.RichTextBox.WinForms.Colored","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vonhoff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"vonhoff"}},"created_at":"2022-05-09T12:44:52.000Z","updated_at":"2025-07-13T07:45:45.000Z","dependencies_parsed_at":"2024-02-08T19:24:10.276Z","dependency_job_id":"f61fd519-790a-4d4a-8c9b-812599ef5cb9","html_url":"https://github.com/vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored","commit_stats":{"total_commits":60,"total_committers":3,"mean_commits":20.0,"dds":0.08333333333333337,"last_synced_commit":"290a7bb1fdc33c38eee8bf498183fc2d61107ae6"},"previous_names":["vonhoff/serilog-sinks-richtextbox-winforms"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vonhoff%2FSerilog.Sinks.RichTextBox.WinForms.Colored","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vonhoff%2FSerilog.Sinks.RichTextBox.WinForms.Colored/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vonhoff%2FSerilog.Sinks.RichTextBox.WinForms.Colored/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vonhoff%2FSerilog.Sinks.RichTextBox.WinForms.Colored/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vonhoff","download_url":"https://codeload.github.com/vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vonhoff%2FSerilog.Sinks.RichTextBox.WinForms.Colored/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265909708,"owners_count":23847498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["colored","colored-log","colored-logging","console","forms","high-contrast","logger","logging","rich-text","richtextbox","serilog","serilog-sink","sink","sinks","themes","windows-forms","winforms"],"created_at":"2024-11-28T05:05:58.030Z","updated_at":"2025-07-21T03:31:12.055Z","avatar_url":"https://github.com/vonhoff.png","language":"C#","funding_links":["https://github.com/sponsors/vonhoff"],"categories":[],"sub_categories":[],"readme":"# Serilog.Sinks.RichTextBox.WinForms.Colored\n\n[![NuGet Downloads](https://img.shields.io/nuget/dt/Serilog.Sinks.RichTextBox.WinForms.Colored.svg)](https://www.nuget.org/packages/Serilog.Sinks.RichTextBox.WinForms.Colored)\n[![workflow](https://img.shields.io/github/actions/workflow/status/vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored/build.yml)](https://github.com/vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored/actions)\n[![Latest version](https://img.shields.io/nuget/v/Serilog.Sinks.RichTextBox.WinForms.Colored.svg)](https://www.nuget.org/packages/Serilog.Sinks.RichTextBox.WinForms.Colored)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nA [Serilog](https://github.com/serilog/serilog) sink that writes log events to a [WinForms RichTextBox](https://docs.microsoft.com/en-us/dotnet/desktop/winforms/controls/richtextbox-control-overview-windows-forms) with support for coloring and custom themes.\n\n![Screenshot of Serilog.Sinks.RichTextBox.WinForms.Colored in action](https://raw.githubusercontent.com/vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored/master/screenshot.png)\n\n## Features\n\n- Colored log events in a WinForms RichTextBox control\n- Multiple theme presets with customization options\n- High-performance asynchronous processing\n- Line limit to control memory usage\n- WCAG compliant color schemes based on the [Serilog WPF RichTextBox](https://github.com/serilog-contrib/serilog-sinks-richtextbox) sink.\n\n## Get Started\n\nInstall the package from NuGet:\n\n```powershell\nInstall-Package Serilog.Sinks.RichTextBox.WinForms.Colored\n```\n\nDeclare your RichTextBox control:\n\n```csharp\nprivate System.Windows.Forms.RichTextBox richTextBox1;\n\nprivate void InitializeComponent()\n{\n    this.richTextBox1.BackColor = System.Drawing.SystemColors.Window;\n    this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;\n    this.richTextBox1.Font = new System.Drawing.Font(\"Cascadia Mono\", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);\n    this.richTextBox1.Location = new System.Drawing.Point(0, 0);\n    this.richTextBox1.Name = \"richTextBox1\";\n}\n```\n\nConfigure the logger to use the sink using the `RichTextBox` extension method:\n\n```csharp\nLog.Logger = new LoggerConfiguration()\n    .WriteTo.RichTextBox(richTextBox1, theme: ThemePresets.Literate)\n    .CreateLogger();\n\nLog.Information(\"Hello, world!\");\n```\n\nSee the [Extension Method](Serilog.Sinks.RichTextBox.WinForms.Colored/RichTextBoxSinkLoggerConfigurationExtensions.cs) for more configuration options.\n\n## Themes\n\nAvailable built-in themes:\n\n| Theme                       | Description                                                                  |\n|-----------------------------|------------------------------------------------------------------------------|\n| `ThemePresets.Literate`     | Styled to replicate the default theme of Serilog.Sinks.Console __(default)__ |\n| `ThemePresets.Grayscale`    | A theme using only shades of gray, white, and black                          |\n| `ThemePresets.Colored`      | A theme based on the original Serilog.Sinks.ColoredConsole sink              |\n| `ThemePresets.Luminous`     | A light theme with high contrast for accessibility                           |\n\nThe themes based on the original sinks are slightly adjusted to be [WCAG compliant](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum), ensuring that the contrast ratio between text and background colors is at least 4.5:1.\n\nYou can create your own custom themes by creating a new instance of the [Theme](Serilog.Sinks.RichTextBox.WinForms.Colored/Sinks/RichTextBoxForms/Themes/Theme.cs) class and passing it to the `RichTextBox` extension method. Look at the [existing themes](Serilog.Sinks.RichTextBox.WinForms.Colored/Sinks/RichTextBoxForms/Themes/ThemePresets.cs) for examples.\n\n## Frequently Asked Questions\n\n### Why is the package name so long?\n\nShorter alternatives were already reserved in the NuGet registry, so a more descriptive name was needed for this implementation. The name is a bit long, but it makes it easier to find the package in the NuGet registry.\n\n### Why use a WinForms RichTextBox instead of a WPF RichTextBox?\n\nThis sink is specifically designed for WinForms applications to avoid the WPF framework. Using a WPF-based logging component would require adding the entire WPF framework with all its dependencies, greatly increasing the size of the application.\n\n## Support and Contribute\n\nIf you find value in this project, there are several ways you can contribute:\n\n- Give the [project](https://github.com/vonhoff/Serilog.Sinks.RichTextBox.WinForms.Colored) a star on GitHub ⭐\n- Support the project through [GitHub Sponsors](https://github.com/sponsors/vonhoff)\n- Improve documentation, report bugs, or submit pull requests\n\n## License\n\nCopyright © 2025 Simon Vonhoff \u0026 Contributors - Provided under the [Apache License, Version 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvonhoff%2FSerilog.Sinks.RichTextBox.WinForms.Colored","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvonhoff%2FSerilog.Sinks.RichTextBox.WinForms.Colored","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvonhoff%2FSerilog.Sinks.RichTextBox.WinForms.Colored/lists"}