VOOZH about

URL: https://www.nuget.org/packages/Serilog.Sinks.Udp/

⇱ NuGet Gallery | Serilog.Sinks.Udp 10.0.1


ο»Ώ

πŸ‘ Image
Serilog.Sinks.Udp 10.0.1

dotnet add package Serilog.Sinks.Udp --version 10.0.1
 
 
NuGet\Install-Package Serilog.Sinks.Udp -Version 10.0.1
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Serilog.Sinks.Udp" Version="10.0.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Serilog.Sinks.Udp" Version="10.0.1" />
 
Directory.Packages.props
<PackageReference Include="Serilog.Sinks.Udp" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Serilog.Sinks.Udp --version 10.0.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Serilog.Sinks.Udp, 10.0.1"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Serilog.Sinks.Udp@10.0.1
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Serilog.Sinks.Udp&version=10.0.1
 
Install as a Cake Addin
#tool nuget:?package=Serilog.Sinks.Udp&version=10.0.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Serilog.Sinks.Udp - A Serilog sink sending UDP packages over the network

πŸ‘ CI/CD
πŸ‘ codecov
πŸ‘ NuGet Version
πŸ‘ SemVer compatible
πŸ‘ NuGet
πŸ‘ Documentation
πŸ‘ Join the chat at https://gitter.im/serilog/serilog
πŸ‘ Help

Package - Serilog.Sinks.Udp | Platforms - .NET Framework 4.6.2, .NET Standard 2.0/2.1

Table of contents


Super simple to use

In the following example, the sink will send UDP packages on the network to localhost on port 7071.

Serilog.ILogger log = new LoggerConfiguration()
 .MinimumLevel.Verbose()
 .WriteTo.Udp("localhost", 7071, AddressFamily.InterNetwork)
 .CreateLogger();

Used in conjunction with Serilog.Settings.Configuration the sink can be configured in appsettings.json.

{
 "Serilog": {
 "MinimumLevel": "Verbose",
 "WriteTo": [
 {
 "Name": "Udp",
 "Args": {
 "remoteAddress": "localhost",
 "remotePort": 7071,
 "family": "InterNetwork"
 }
 }
 ]
 }
}

Used in conjunction with Serilog.Settings.AppSettings the sink can be configured in XML <appSettings>.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <appSettings>
 <add key="serilog:minimum-level" value="Verbose" />
 <add key="serilog:using:Udp" value="Serilog.Sinks.Udp" />
 <add key="serilog:write-to:Udp" />
 <add key="serilog:write-to:Udp.remoteAddress" value="localhost" />
 <add key="serilog:write-to:Udp.remotePort" value="7071" />
 <add key="serilog:write-to:Udp.family" value="InterNetwork" />
 </appSettings>
</configuration>

Typical use case

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.

In development I've been sending UDP packages to the loopback address, and used Log2Console to visualize them. It supports UDP receivers, and allows me to filter and search according to my needs.

Taking it to the next level is when you as a team agree on sending the log events to a multicast address, making them accessible to all team members. This can be beneficial for Quality Assurance who wishes to monitor log events from all instances of your running application.

Event formatters

The event formatter is an output template on steroids. It has the responsibility of turning a single log event into a textual representation. It can serialize the log event into JSON, XML or anything else that matches the expectations of the receiver.

The sink comes pre-loaded with two XML based event formatters. One is matching the log4j schema expected by Log2Console and the other is matching the log4net schema expected by Log4View.

Log4jTextFormatter

The log event is formatted according to the log4j XML schema expected by Log2Console.

<log4j:event logger="Some.Serilog.Context" timestamp="1184286222308" level="ERROR" thread="1">
 <log4j:message>Something failed</log4j:message>
 <log4j:throwable>An exception describing the failure<log4j:throwable>
</log4j:event>

Log4netTextFormatter

The log event is formatted according to the log4net XML schema expected by Log4View.

<log4net:event logger="Some.Serilog.Context" timestamp="2017-09-01T22:00:00.000+02:00" level="DEBUG" thread="1" username="MACHINE\username" domain="dotnet">
 <log4net:locationInfo class="Some.Serilog.Context" method="System.String Get(Int32)"/>
 <log4net:properties>
 <log4net:data name="log4net:HostName" value="MACHINE"/>
 </log4net:properties>
 <log4net:message>Something went wrong.</log4net:message>
 <log4net:throwable>System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.</log4net:throwable>
</log4net:event>

Sample applications

The following sample applications demonstrate the usage of this sink in various contexts:

Install via NuGet

If you want to include the UDP 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.Udp

Donations

If this project has helped you to stay productive and save money, you can buy me a cup of coffee πŸ˜ƒ

πŸ‘ PayPal Donate

Credit

Thank you JetBrains for your important initiative to support the open source community with free licenses to your products.

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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Serilog.Sinks.Udp:

Package Downloads
MTD.BM.Common

歀樑块为MTDη³»η»ŸεŸΊη‘€ζ¨‘ε—οΌŒεŒ…ε«ε€šδΈͺη»„δ»Ά

GL

Package Description

CnWeb.Top.Logging

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.1 58,047 1/3/2026
10.0.0 911,722 4/3/2024
10.0.0-beta.1 188 4/3/2024
9.0.0 302,373 10/19/2023
9.0.0-beta.2 3,188 6/1/2023
8.0.1 982,123 11/20/2022
8.0.0 179,712 3/26/2022
7.1.0 504,181 10/19/2020
7.0.1 24,388 8/14/2020
7.0.0 1,054,864 3/9/2020
6.0.0 333,517 7/8/2019
6.0.0-beta4 1,243 7/7/2019
6.0.0-beta3 1,215 6/30/2019
6.0.0-beta2 4,310 3/29/2019
6.0.0-beta1-6.0.0-beta1-00689 11,793 3/27/2019
5.0.1 134,460 1/6/2019
5.0.0 14,929 9/13/2018
4.1.0 574,016 6/6/2018
4.1.0-release-4-1-0-beta-1-... 1,969 6/1/2018
Loading failed

For release notes, please see the change log on GitHub.