Net.Gelf.Client 1.0.1

dotnet add package Net.Gelf.Client --version 1.0.1                
NuGet\Install-Package Net.Gelf.Client -Version 1.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="Net.Gelf.Client" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Net.Gelf.Client --version 1.0.1                
#r "nuget: Net.Gelf.Client, 1.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.
// Install Net.Gelf.Client as a Cake Addin
#addin nuget:?package=Net.Gelf.Client&version=1.0.1

// Install Net.Gelf.Client as a Cake Tool
#tool nuget:?package=Net.Gelf.Client&version=1.0.1                

[[TOC]]

Default Constructor

Start using it by creating UdpGelfClient with some constructors:

var client = new UdpGelfClient();

Default one sets port and host to default values for UDP in Graylog:

  • the host will be "localhost";
  • the port will be 12201;

Custom host and address

If you still want default fast experience, but you have a different address than default one, then you can use a constructor with host and port.

var client = new UdpGelfClient("host", 123);

Custom client settings

If you want to configure your client under your needs, then you can use GelfClientSettings DTO to store your configuration. Pass your settings to UpdGelfClient constructor:

var settings = new ClientSettings { Host = "myHost", Port=123, NeedCompression = false };
var client = new UdpGelfClient(settings);

Sending a message

You can send data to your Graylog by using your client.

var message = new Message { ShortMessage = "My log message" };
await client.Send(message);

Reference to the original project

Original lib: https://github.com/mattwcole/gelf-extensions-logging

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

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 4,122 4/20/2020
1.0.0 456 4/20/2020