![]() |
VOOZH | about |
dotnet add package Serilog.Sinks.Http --version 9.2.1
NuGet\Install-Package Serilog.Sinks.Http -Version 9.2.1
<PackageReference Include="Serilog.Sinks.Http" Version="9.2.1" />
<PackageVersion Include="Serilog.Sinks.Http" Version="9.2.1" />Directory.Packages.props
<PackageReference Include="Serilog.Sinks.Http" />Project file
paket add Serilog.Sinks.Http --version 9.2.1
#r "nuget: Serilog.Sinks.Http, 9.2.1"
#:package Serilog.Sinks.Http@9.2.1
#addin nuget:?package=Serilog.Sinks.Http&version=9.2.1Install as a Cake Addin
#tool nuget:?package=Serilog.Sinks.Http&version=9.2.1Install as a Cake Tool
👁 CI/CD
👁 codecov
👁 NuGet Version
👁 SemVer compatible
👁 NuGet
👁 Documentation
👁 Join the chat at https://gitter.im/serilog/serilog
👁 Help
Package - Serilog.Sinks.Http | Platforms - .NET 4.6.2, .NET Standard 2.0/2.1
This project started out with a wish to send log events to the Elastic Stack. I had prior experience of Elastic Filebeat and didn't like it. I thought the value it added was lower than the complexity it introduced.
Knowing that Serilog.Sinks.Seq existed, and knowing that the code was of really good quality, I blatantly copied many of the core files into this project and started developing a general HTTP sink.
And here we are today. I hope you'll find the sink useful. If not, don't hesitate to open an issue.
In the following example, the sink will POST log events to https://www.mylogs.com over HTTP. We configure the sink using named arguments instead of positional because historically we've seen that most breaking changes where the result of a new parameter describing a new feature. Using named arguments means that you more often than not can migrate to new major versions without any changes to your code.
ILogger log = new LoggerConfiguration()
.MinimumLevel.Verbose()
.WriteTo.Http(requestUri: "https://www.mylogs.com", queueLimitBytes: null)
.CreateLogger();
log.Information("Logging {@Heartbeat} from {Computer}", heartbeat, computer);
Used in conjunction with Serilog.Settings.Configuration the same sink can be configured in the following way:
{
"Serilog": {
"MinimumLevel": "Verbose",
"WriteTo": [
{
"Name": "Http",
"Args": {
"requestUri": "https://www.mylogs.com",
"queueLimitBytes": null
}
}
]
}
}
The sink can also be configured to be durable, i.e. log events are persisted on disk before being sent over the network, thus protected against data loss after a system or process restart. For more information please read the wiki.
The sink is batching multiple log events into a single request, and the following hypothetical payload is sent over the network as JSON.
[
{
"Timestamp": "2016-11-03T00:09:11.4899425+01:00",
"Level": "Information",
"MessageTemplate": "Logging {@Heartbeat} from {Computer}",
"RenderedMessage": "Logging { UserName: \"Mike\", UserDomainName: \"Home\" } from \"Workstation\"",
"TraceId": "8feaddac8f663113b19488ef2824b416",
"SpanId": "0caf323920535f7d",
"Properties": {
"Heartbeat": {
"UserName": "Mike",
"UserDomainName": "Home"
},
"Computer": "Workstation"
}
},
{
"Timestamp": "2016-11-03T00:09:12.4905685+01:00",
"Level": "Information",
"MessageTemplate": "Logging {@Heartbeat} from {Computer}",
"RenderedMessage": "Logging { UserName: \"Mike\", UserDomainName: \"Home\" } from \"Workstation\"",
"TraceId": "ded4fb3d962c6e06498bf74ba3b44312",
"SpanId": "5a7d2de54a0b083e",
"Properties": {
"Heartbeat": {
"UserName": "Mike",
"UserDomainName": "Home"
},
"Computer": "Workstation"
}
}
]
Producing log events is only half the story. Unless you are consuming them in a matter that benefits you in development or production, there is really no need to produce them in the first place.
Integration with Elastic Stack (formerly know as ELK, an acronym for Elasticsearch, Logstash and Kibana) is powerful beyond belief, but there are many alternatives to get the log events into Elasticsearch.
A common solution, given your application is running in Docker containers, is to have stdout (standard output) and stderr (standard error) passed on to the Elastic Stack. There is a multitude of ways to accomplish this, but one using Logspout is linked in the Sample applications chapter.
The log events can be sent directly to Elasticsearch using Serilog.Sinks.Elasticsearch. In this case you've solved your problem without using this sink, and all is well in the world.
If you would like to send the log events to Logstash for further processing instead of sending them directly to Elasticsearch, this sink in combination with the Logstash HTTP input plugin is the perfect match for you. It is a much better solution than having to install Filebeat on all your instances, mainly because it involves fewer moving parts.
The following sample applications demonstrate the usage of this sink in various contexts:
The following sample application demonstrate how Serilog events from a Docker container end up in the Elastic Stack using Logspout, without using Serilog.Sinks.Http.
If you want to include the HTTP sink in your project, you can install it directly from NuGet.
To install the sink, run the following command in the Package Manager Console:
PM> Install-Package Serilog.Sinks.Http
The following users have made significant contributions to this project. Thank you so much!
<table> <tbody> <tr> <td align="center" valign="top" width="14.28%"><a href="https://jetbrains.com/opensource"><img src="https://avatars.githubusercontent.com/u/878437?v=4?s=100" width="100px;" alt="JetBrains"/><br /><sub><b>JetBrains</b></sub></a><br /><a href="#infra-JetBrains" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td> <td align="center" valign="top" width="14.28%"><a href="https://augustoproiete.net/"><img src="https://avatars.githubusercontent.com/u/177608?v=4?s=100" width="100px;" alt="C. Augusto Proiete"/><br /><sub><b>C. Augusto Proiete</b></sub></a><br /><a href="#financial-augustoproiete" title="Financial">💵</a> <a href="#question-augustoproiete" title="Answering Questions">💬</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=augustoproiete" title="Code">💻</a> <a href="#ideas-augustoproiete" title="Ideas, Planning, & Feedback">🤔</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/lhaussknecht"><img src="https://avatars.githubusercontent.com/u/140147?v=4?s=100" width="100px;" alt="Louis Haußknecht"/><br /><sub><b>Louis Haußknecht</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=lhaussknecht" title="Code">💻</a> <a href="#ideas-lhaussknecht" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Alhaussknecht" title="Bug reports">🐛</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/rob-somerville"><img src="https://avatars.githubusercontent.com/u/12766610?v=4?s=100" width="100px;" alt="rob-somerville"/><br /><sub><b>rob-somerville</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=rob-somerville" title="Code">💻</a> <a href="#ideas-rob-somerville" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Arob-somerville" title="Bug reports">🐛</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/kvpt"><img src="https://avatars.githubusercontent.com/u/1446221?v=4?s=100" width="100px;" alt="Kevin Petit"/><br /><sub><b>Kevin Petit</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=kvpt" title="Code">💻</a> <a href="#ideas-kvpt" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Akvpt" title="Bug reports">🐛</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/aleksaradz"><img src="https://avatars.githubusercontent.com/u/72725560?v=4?s=100" width="100px;" alt="aleksaradz"/><br /><sub><b>aleksaradz</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=aleksaradz" title="Code">💻</a> <a href="#ideas-aleksaradz" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Aaleksaradz" title="Bug reports">🐛</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/michaeltdaniels"><img src="https://avatars.githubusercontent.com/u/45430678?v=4?s=100" width="100px;" alt="michaeltdaniels"/><br /><sub><b>michaeltdaniels</b></sub></a><br /><a href="#ideas-michaeltdaniels" title="Ideas, Planning, & Feedback">🤔</a></td> </tr> <tr> <td align="center" valign="top" width="14.28%"><a href="https://github.com/dusse1dorf"><img src="https://avatars.githubusercontent.com/u/37047967?v=4?s=100" width="100px;" alt="dusse1dorf"/><br /><sub><b>dusse1dorf</b></sub></a><br /><a href="#ideas-dusse1dorf" title="Ideas, Planning, & Feedback">🤔</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/vaibhavepatel"><img src="https://avatars.githubusercontent.com/u/23142694?v=4?s=100" width="100px;" alt="vaibhavepatel"/><br /><sub><b>vaibhavepatel</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Avaibhavepatel" title="Bug reports">🐛</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=vaibhavepatel" title="Code">💻</a> <a href="#ideas-vaibhavepatel" title="Ideas, Planning, & Feedback">🤔</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/KalininAndreyVictorovich"><img src="https://avatars.githubusercontent.com/u/1285535?v=4?s=100" width="100px;" alt="KalininAndreyVictorovich"/><br /><sub><b>KalininAndreyVictorovich</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3AKalininAndreyVictorovich" title="Bug reports">🐛</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=KalininAndreyVictorovich" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/tipasergio"><img src="https://avatars.githubusercontent.com/u/6435956?v=4?s=100" width="100px;" alt="Sergios"/><br /><sub><b>Sergios</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Atipasergio" title="Bug reports">🐛</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/AntonSmolkov"><img src="https://avatars.githubusercontent.com/u/5318028?v=4?s=100" width="100px;" alt="Anton Smolkov"/><br /><sub><b>Anton Smolkov</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=AntonSmolkov" title="Code">💻</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3AAntonSmolkov" title="Bug reports">🐛</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/Siphonophora"><img src="https://avatars.githubusercontent.com/u/32316111?v=4?s=100" width="100px;" alt="Michael J Conrad"/><br /><sub><b>Michael J Conrad</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=Siphonophora" title="Documentation">📖</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/seruminar"><img src="https://avatars.githubusercontent.com/u/35008875?v=4?s=100" width="100px;" alt="Yuriy Sountsov"/><br /><sub><b>Yuriy Sountsov</b></sub></a><br /><a href="#ideas-seruminar" title="Ideas, Planning, & Feedback">🤔</a></td> </tr> <tr> <td align="center" valign="top" width="14.28%"><a href="https://github.com/yuriy-millen"><img src="https://avatars.githubusercontent.com/u/90191982?v=4?s=100" width="100px;" alt="Yuriy Millen"/><br /><sub><b>Yuriy Millen</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=yuriy-millen" title="Code">💻</a> <a href="#ideas-yuriy-millen" title="Ideas, Planning, & Feedback">🤔</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/murlidakhare"><img src="https://avatars.githubusercontent.com/u/28730670?v=4?s=100" width="100px;" alt="murlidakhare"/><br /><sub><b>murlidakhare</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Amurlidakhare" title="Bug reports">🐛</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/julichan"><img src="https://avatars.githubusercontent.com/u/27727780?v=4?s=100" width="100px;" alt="julichan"/><br /><sub><b>julichan</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Ajulichan" title="Bug reports">🐛</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/janichirag11"><img src="https://avatars.githubusercontent.com/u/45846228?v=4?s=100" width="100px;" alt="janichirag11"/><br /><sub><b>janichirag11</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Ajanichirag11" title="Bug reports">🐛</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/prasadpaul53"><img src="https://avatars.githubusercontent.com/u/78130718?v=4?s=100" width="100px;" alt="PaulP"/><br /><sub><b>PaulP</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Aprasadpaul53" title="Bug reports">🐛</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/consulting-dev"><img src="https://avatars.githubusercontent.com/u/155075432?v=4?s=100" width="100px;" alt="consulting-dev"/><br /><sub><b>consulting-dev</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=consulting-dev" title="Code">💻</a> <a href="#ideas-consulting-dev" title="Ideas, Planning, & Feedback">🤔</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/josephcappellino"><img src="https://avatars.githubusercontent.com/u/354186?v=4?s=100" width="100px;" alt="josephcappellino"/><br /><sub><b>josephcappellino</b></sub></a><br /><a href="https://github.com/josephcappellino/serilog-sinks-http/commits?author=josephcappellino" title="Code">💻</a> <a href="#ideas-josephcappellino" title="Ideas, Planning, & Feedback">🤔</a></td> </tr> </tbody> </table>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Serilog.Sinks.Http:
| Package | Downloads |
|---|---|
|
Serilog.Sinks.Loki
A Serilog Sink for Grafana's Loki log aggregator |
|
|
Serilog.Sinks.Logz.Io
Serilog event sink that sends logs to Logz.io. |
|
|
Serilog.Sinks.Dynatrace
Serilog Sink that sends log events to Dynatrace https://www.dynatrace.com/ |
|
|
BetterStack.Logs.Serilog
Package Description |
|
|
Aj.Platform.Core
Biblioteca de Uso Geral para integrações com as API OmsAj |
Showing the top 6 popular GitHub repositories that depend on Serilog.Sinks.Http:
| Repository | Stars |
|---|---|
|
TechnitiumSoftware/DnsServer
Technitium DNS Server
|
|
|
slskd/slskd
A modern client-server application for the Soulseek file sharing network.
|
|
|
charlessolar/eShopOnContainersDDD
Fork of dotnet-architecture/eShopOnContainers in full DDD/CQRS design using my own patterns
|
|
|
TuralSuleymani/the-real-DDD-CQRS-CleanArchitecture
A real-world example of a shopping basket API built with C#, showcasing Domain-Driven Design (DDD), Clean Architecture, and CQRS patterns. Includes features like basket management, discount application, and event-driven design with Kafka.
|
|
|
keremvaris/Sennedjem
Sennedjem CQRS (Command Query Responsibility Segregation) yaklaşımını benimseyen ve SOLID prensiplerini ve Clean Architecture yöntemlerini odaklayan bir yazılım geliştirme alt yapısıdır. RabbitMq, ElasticSearch vb araçlara entegre olmak konusunda çok yeteneklidir.
|
|
|
josephwoodward/Serilog-Sinks-Loki
A Serilog Sink for Loki, Grafana's new Prometheus inspired log aggregator
|
| Version | Downloads | Last Updated |
|---|---|---|
| 9.2.1 | 598,920 | 1/3/2026 |
| 9.2.0 | 801,834 | 8/2/2025 |
| 9.1.1 | 1,008,621 | 3/16/2025 |
| 9.1.0 | 854,770 | 1/19/2025 |
| 9.0.0 | 3,509,718 | 4/14/2024 |
| 9.0.0-beta.2 | 31,140 | 3/27/2024 |
| 9.0.0-beta.1 | 123,756 | 4/12/2023 |
| 8.0.0 | 8,486,190 | 4/10/2022 |
| 8.0.0-beta.11 | 2,061 | 2/20/2022 |
| 8.0.0-beta.10 | 2,468 | 12/18/2021 |
| 8.0.0-beta.9 | 146,851 | 8/22/2021 |
| 8.0.0-beta.8 | 81,628 | 8/14/2021 |
| 8.0.0-beta.7 | 719,920 | 5/10/2021 |
| 8.0.0-beta.6 | 476 | 5/7/2021 |
| 8.0.0-beta.5 | 449 | 5/4/2021 |
| 8.0.0-beta.4 | 445 | 4/29/2021 |
| 8.0.0-beta.3 | 4,713 | 3/30/2021 |
| 8.0.0-beta.2 | 1,200 | 3/15/2021 |
| 8.0.0-beta.1 | 912 | 3/8/2021 |
| 7.3.0-af8c758 | 11,083 | 1/23/2021 |