C#
LogHive provides a simple REST API that you can use to push events and errors. Here is an example code for C#:
C# SDK
You're lucky! There is already an SDK available for C# that you can easily download via NuGet. With this, you only need a maximum of two lines of code to push an event to LogHive.
The SDK internally uses HttpClient, so you only need to instantiate LogHiveApi once.
NuGet Link: https://www.nuget.org/packages/LogHive
GitHub Link: https://github.com/loghive
Serilog Sink
This C# library is a sink for the Serilog Logging Framework. With this extension, all log events that occur are automatically transmitted to the event and log service LogHive.
NuGet Link: https://www.nuget.org/packages/Serilog.Sinks.LogHive/
GitHub Link: https://github.com/loghive/serilog-sinks-loghive
AppSettings
To ensure that the Serilog extension is found, you should include the namespace Serilog.Sinks.LogHive in your Usings section.
ApiKey: your personal api key
RestrictedToMinimumLevel: minimum Log Level to push the event to LogHive
MinimumPushNotificationLevel: minimum Log Level to push a notification
ParseMessageTemplateForEventName: parse message template to full string without property placeholders (default: false)
You can also instantiate logging directly through the code:
Last updated