![]() |
VOOZH | about |
dotnet add package Blip.Starter.Common.Logs --version 0.0.27
NuGet\Install-Package Blip.Starter.Common.Logs -Version 0.0.27
<PackageReference Include="Blip.Starter.Common.Logs" Version="0.0.27" />
<PackageVersion Include="Blip.Starter.Common.Logs" Version="0.0.27" />Directory.Packages.props
<PackageReference Include="Blip.Starter.Common.Logs" />Project file
paket add Blip.Starter.Common.Logs --version 0.0.27
#r "nuget: Blip.Starter.Common.Logs, 0.0.27"
#:package Blip.Starter.Common.Logs@0.0.27
#addin nuget:?package=Blip.Starter.Common.Logs&version=0.0.27Install as a Cake Addin
#tool nuget:?package=Blip.Starter.Common.Logs&version=0.0.27Install as a Cake Tool
First of all, please read all pages of our Logging documentation.
You must configure your application to be able to have its logs collected correctly.
Add Blip.Starter.Common.Traces NuGet package to your project to configure your application.
The NuGet package is published in our private NuGet repository: https://dev.azure.com/curupira/BLiP/_artifacts/feed/BlipNuget/NuGet/Blip.Starter.Common.Traces/overview/0.0.9
To access it locally you will need to install Azure Artifacts credential provider.
Then, in your Startup.cs file or anywhere you configure the framework, add the following code:
// You can change the configuration if needed
ILogConfiguration configuration = DefaultLogConfiguration();
// Create the environment with correct values (read it from your configuration or environment variables)
Env.Environment environment = new Env.Environment("your-app-deploy-name", "your-app-deploy-version", "the-cluster-your-app-is-deployed");
// Integrate the Serilog log sink with the IServiceCollection using the extension from LogSinkExtension
services.AddLogSink(configuration, environment);
You can also use the .NET IConfiguration interface having the fields LogSink for the ILogConfiguration and $Metadata for the Env.Environment to configure your application as following:
// This is an example of how to get the configuration from the builder, but this code will already be in your application
var builder = WebApplication.CreateBuilder(args);
IConfiguration config = builder.Configuration;
builder.Services.AddLogSink(config);
If you must configure Serilog sink manually because you do not use ASP.NET Core, you can do it like this:
// You can change the configuration if needed
ILogConfiguration configuration = DefaultLogConfiguration();
// Create the environment with correct values (read it from your configuration or environment variables)
Env.Environment environment = new Env.Environment("your-app-deploy-name", "your-app-deploy-version", "the-cluster-your-app-is-deployed");
Log.Logger = LoggerSimpleStarter.Create(loggerConfiguration, environment).CreateLogger();
After configuring the instrumentation, there is a few things you must ensure to have your logs sent to Grafana Loki.
Please read the documentation to know what to do.
Please make sure your cluster already have a Promtail configured by asking to SRE team.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.