Using Visual Studio?
Install packages in Tools β Manage NuGet Packages....
Which .NET logger do you want to use to send logs to Better Stack?
Install NLog.Extension.Logging and BetterStack.Logs.NLog packages:
Install packages in Tools β Manage NuGet Packages....
Set up NLog logging with Better Stack. Save the following config as nlog.config in your project root:
Add the following configuration to your .csproj file:
Right-click file nlog.config β Quick Properties β Copy to Output Directory.
Use NLog logger as usual:
You should see your logs in Better Stack β Live tail.
Find passed structured data under the context.properties field.
Install Serilog.Extensions.Logging and BetterStack.Logs.Serilog packages:
Install packages in Tools β Manage NuGet Packages....
Use Serilog logger with configured .WriteTo.BetterStack() sink:
You should see your logs in Better Stack β Live tail.
Find passed structured data under the properties field.
You can see example projects for both NLog and Serilog integration.
For logs to be sent to Better Stack reliably, Serilog must be properly closed by Log.CloseAndFlush(), even when the application ends unexpectedly. For more information, see Lifecycle of Loggers in Serilog docs.
For more on Serilog configuration, see their official docs.
Please let us know at hello@betterstack.com.
We're happy to help! π
We use cookies to authenticate users, improve the product user experience, and for personalized ads. Learn more.