Contents
Install Instructions¶
A full working example can be found here.
Install NuGet Package
PM> Install-Package Serilog.Sinks.LogBee
Update Program.cs
Set the LogBeeApiKey with the values from the logBee.net application configuration page.
using Serilog.Sinks.LogBee;
namespace Serilog.Sinks.LogBee_ConsoleApp;
class Program
{
static void Main(string[] args)
{
Log.Logger =
new LoggerConfiguration()
.WriteTo.LogBee(
new LogBeeApiKey("_OrganizationId_", "_ApplicationId_", "https://api.logbee.net")
)
.CreateLogger();
try
{
string name = "Serilog";
Log.Information("Hello, {Name}!", name);
throw new NullReferenceException("Oops...");
}
catch (Exception ex)
{
Log.Error(ex, "Unhandled exception");
}
finally
{
// flush the logger so the events are sent to the logBee endpoint
Log.CloseAndFlush();
}
}
}
For technical support, questions or any feedback, please feel free to send us a message and we will get back to you.