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
<PackageReference Include="Net.Gelf.Client" Version="1.0.1" />
paket add Net.Gelf.Client --version 1.0.1
#r "nuget: Net.Gelf.Client, 1.0.1"
// 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 | Versions 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. |
-
- Newtonsoft.Json (>= 12.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.