Last updated
Last updated
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:
GitHub Link:
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.
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:
NuGet Link:
GitHub Link:
LogHive provides a simple REST API that you can use to push events and errors. Here is an example code for C#: